Skip to content

Commit 0eae8c0

Browse files
committed
make it clear that v-bind:class can coexist with plain class
1 parent ac8fcd5 commit 0eae8c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/guide/class-and-style.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ A common need for data binding is manipulating an element's class list and its i
99

1010
### Object Syntax
1111

12-
We can pass an Object to `v-bind:class` to dynamically toggle classes:
12+
We can pass an Object to `v-bind:class` to dynamically toggle classes. Note the `v-bind:class` directive can co-exist with the plain `class` attribute:
1313

1414
``` html
15-
<div v-bind:class="{ 'class-a': isA, 'class-b': isB }"></div>
15+
<div class="static" v-bind:class="{ 'class-a': isA, 'class-b': isB }"></div>
1616
```
1717
``` js
1818
data: {
@@ -24,7 +24,7 @@ data: {
2424
Which will render:
2525

2626
``` html
27-
<div class="class-a"></div>
27+
<div class="static class-a"></div>
2828
```
2929

3030
When `isA` and `isB` changes, the class list will be updated accordingly. For example, if `isB` becomes `true`, the class list will become `"class-a class-b"`.

0 commit comments

Comments
 (0)