Skip to content

Commit 9be3dd7

Browse files
authored
Merge pull request #1271 from sdras/falsy
Clarify falsy conditions for attribute description
2 parents cb47409 + 255cf81 commit 9be3dd7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/v2/guide/syntax.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,20 @@ 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+
If `isButtonDisabled` has the value of `null`, `undefined`, or `false`, the `disabled` attribute will not even be included in the rendered `<button>` element.
58+
5759
### Using JavaScript Expressions
5860

5961
So far we've only been binding to simple property keys in our templates. But Vue.js actually supports the full power of JavaScript expressions inside all data bindings:

0 commit comments

Comments
 (0)