【发布时间】:2017-04-03 14:21:54
【问题描述】:
在我看来,我有以下条件类:
<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() 的结果如何。我做错了什么?
【问题讨论】:
标签: vue.js vuejs2 vue-component