Skip to content

Instantly share code, notes, and snippets.

@foreverplay
Created August 2, 2018 08:46
Show Gist options
  • Save foreverplay/14d18d425459c3d4fd964d6a05cef67f to your computer and use it in GitHub Desktop.
Save foreverplay/14d18d425459c3d4fd964d6a05cef67f to your computer and use it in GitHub Desktop.
vue v-bind:class 设置多个class赋值
vue 动态渲染时,需要将多个变量设置为class
解决办法:
使用Array数组传入多个类名
v-bind:class="[obj1,obj2]"
v-bind:class="[((istrue)?'string1':'string2'),obj2]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment