Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Binding of V-bind to classes and styles
Binding of V-bind to classes and styles
Function: v-bind is usually used to bind attributes and dynamically bind some class names or styles. The format is v-bind: attribute name = "value ",abbreviated as: attribute name = "value".

Variable syntax: v-bind: class = "variable ",in variable form, where the value of the variable is usually the class name defined in css;

Array syntax: v-v-bind: class = "[[variable1,variable 2]", the array form is actually similar to the above, except that multiple class names can be bound at the same time;

Object syntax: v-bind: class = {classname1:Boolean, classname 2: Boolean}, object form, where classname 1(2) is actually the class name in the style sheet, and Boolean here is usually a variable, constant, calculation attribute, etc. This method is also the most commonly used method to bind classes.