Skip to content

Commit f639b83

Browse files
committed
2.6: document shorthand for v-bind .prop modifier
1 parent 177f0af commit f639b83

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/v2/api/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2142,6 +2142,9 @@ type: api
21422142
<!-- DOM attribute binding with prop modifier -->
21432143
<div v-bind:text-content.prop="text"></div>
21442144
2145+
<!-- shorthand for prop modifier (2.6+) -->
2146+
<div .text-content="text"></div>
2147+
21452148
<!-- prop binding. "prop" must be declared in my-component. -->
21462149
<my-component :prop="someThing"></my-component>
21472150

src/v2/guide/syntax.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Mustaches cannot be used inside HTML attributes. Instead, use a [v-bind directiv
6666
<div v-bind:id="dynamicId"></div>
6767
```
6868

69-
In the case of boolean attributes, where their mere existence implies `true`, `v-bind` works a little differently. In this example:
69+
In the case of boolean attributes, where their mere existence implies `true`, `v-bind` works a little differently. In this example:
7070

7171
``` html
7272
<button v-bind:disabled="isButtonDisabled">Button</button>
@@ -152,6 +152,18 @@ The `v-` prefix serves as a visual cue for identifying Vue-specific attributes i
152152
<a :href="url"> ... </a>
153153
```
154154

155+
> New in 2.6
156+
157+
In 2.6 a separate shorthand for explicit DOM property bindings (with the `.prop` modifier) have been introduced:
158+
159+
``` html
160+
<!-- full syntax -->
161+
<video v-bind:muted.prop="isMuted"> ... </video>
162+
163+
<!-- shorthand -->
164+
<video .muted="isMuted"> ... </video>
165+
```
166+
155167
### `v-on` Shorthand
156168

157169
``` html

0 commit comments

Comments
 (0)