问答详情
源自:2-5 条件渲染、列表渲染、Class与Style绑定

在class中添加 {’another‘:age>29} 后就报错了 这是为啥呀?

错误提示:

Uncaught DOMException: Failed to execute 'add' on 'DOMTokenList': The token provided ('[object Object]') contains HTML space characters, which are not valid in tokens.

源码:

 <div v-show="item.age > 29"

          :class="['active','add','more',{'another':true}]"    <-就是这一行 去掉那个another就可以 但是加上就不行。。我迷了。。

          :style = 'styleMsg'>

          {{item.name}}

        </div>


提问者:超级大傻花_biu_biu 2020-04-24 16:51

个回答

  • 慕工程2159954
    2020-10-07 17:19:21

    {'another':item.age>29}