Vue.js bound HTML class array syntax error, as shown in the details below:
Yesterday in the official website of the tutorial found a mistake is like this, look at the following picture
Http://cn.vuejs.org/guide/class-and-style.html
This is a bit cumbersome to write when you have more than one condition class. In 1.0.19+, object syntax can be used in array syntax:
If you write this, you can do it successfully, but there are errors
Data: {
ClassA: ' class-a ',
classb: ' Class-b ',
classc: ' class-c ', Isb:true
,
isc:false
}
<div:class= "[ClassA, {CLASSB:ISB, classc:isc}]" >
Render as:
<div class= "Class-a classb" >
If the class-b is not successful, the standard object syntax should be quoted here.
<div:class= "[ClassA, {' Class-b ': IsB, ' class-c ': IsC}]" >
Render as:
<div class= "Class-a class-b" >
The above is a small set to introduce the Vue.js bound HTML class array syntax error, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!