0
类
计算值在我看来,我有以下条件类:Vue.js:为
<td class="text-center" v-bind:class="{ positivity }"></td>
,并在我的组件我有以下几点:
positivity: function() {
var type = typeof this.transaction.weeks != "undefined"
var positive = 'green-bold'
if (type) {
positive = 'red-bold'
}
return positive
}
...但后来我计算类显示为:
<td class="text-center positivity"></td>
不管结果为positivity()
。我究竟做错了什么?
谢谢!不知道为什么我包括大括号 –