【发布时间】:2016-12-30 14:18:53
【问题描述】:
我已经使用 vue 大约一个月了,但是我还没有真正能够正确完成的一件事就是这个。
所以在树枝中我们可以做这样的事情
<th class="
{% if condition %}
class1
{% else %}
class2
{% end if %}
">
<th class="sorting_asc" v-for="col in columns" v-if="col.label == sortKey">
<th class="sorting" v-for="col in columns" v-else>
所以我的第一个问题是我似乎无法在 Vue js 中实现类似的功能。其次,我写了'v-if="col.label == sortKey"',我什至可以在html块之外(循环外)访问汽车col.label。提前谢谢你
【问题讨论】:
标签: javascript class styling vue.js