Vue knowledge finishing 9: class and style bindings

1.v-bind: class: Binding class style. IsActive achieved by controlling the variable value is displayed; .active pattern by setting the background color.

 

2. Support ordinary class with v-bind binding style mixed use;

  v-bind dynamically support multiple patterns, for example, increasing a green: isGreen dynamic pattern; style added following the appropriate style.

There is also support an array of style names in the v-bind as follows:

Also supports the ternary operator, dynamic style.

 

3.v-bind: style in the style inline style

 

Also supports the ternary operator

 

Guess you like

Origin www.cnblogs.com/KKSoft/p/11619973.html