Skip to content

Commit 1a52ccb

Browse files
Document v-bind.attr shorthand in API section. (#1571)
* Document v-bind.attr shorthand in API section. * Update src/api/built-in-directives.md Co-authored-by: skirtle <[email protected]> Co-authored-by: skirtle <[email protected]>
1 parent 05c75f6 commit 1a52ccb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/api/built-in-directives.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,13 +319,16 @@ Dynamically bind one or more attributes, or a component prop to an expression.
319319
<svg><a :xlink:special="foo"></a></svg>
320320
```
321321

322-
The `.prop` modifier also has a dedicated shorthand, `.`:
322+
The `.prop` and `.attr` modifiers also have a dedicated shorthand, `.` and `^` respectively:
323323

324324
```vue-html
325325
<div :someProperty.prop="someObject"></div>
326-
327326
<!-- equivalent to -->
328327
<div .someProperty="someObject"></div>
328+
329+
<div :someProperty.attr="someString"></div>
330+
<!-- equivalent to -->
331+
<div ^someProperty="someString"></div>
329332
```
330333

331334
The `.camel` modifier allows camelizing a `v-bind` attribute name when using in-DOM templates, e.g. the SVG `viewBox` attribute:

0 commit comments

Comments
 (0)