Created
August 2, 2018 08:46
-
-
Save foreverplay/14d18d425459c3d4fd964d6a05cef67f to your computer and use it in GitHub Desktop.
vue v-bind:class 设置多个class赋值
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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