Skip to content

Commit 255cf81

Browse files
authored
Tweak v-bind boolean example
1 parent 00a1310 commit 255cf81

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/v2/guide/syntax.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@ The contents of this `div` will be replaced with the value of the `rawHtml` prop
4242

4343
### Attributes
4444

45-
Mustaches cannot be used inside HTML attributes, instead use a [v-bind directive](../api/#v-bind):
45+
Mustaches cannot be used inside HTML attributes. Instead, use a [v-bind directive](../api/#v-bind):
4646

4747
``` html
4848
<div v-bind:id="dynamicId"></div>
4949
```
5050

51-
It also works for boolean attributes - the attribute will be removed if the condition evaluates to a falsy value:
51+
In the case of boolean attributes, where their mere existence implies `true`, `v-bind` works a little differently. In this example:
5252

5353
``` html
5454
<button v-bind:disabled="isButtonDisabled">Button</button>
5555
```
5656

57-
This will be removed if the value is `null`, `undefined`, or `false`. `0` and `NaN` will still be displayed.
57+
If `isButtonDisabled` has the value of `null`, `undefined`, or `false`, the `disabled` attribute will not even be included in the rendered `<button>` element.
5858

5959
### Using JavaScript Expressions
6060

0 commit comments

Comments
 (0)