var vm = new Vue({
el: "#list",
data: {
messages: []
},
filters: {
convertType: function (type) {
return type === 0 ? 'me' : 'other';
}
}
});
这是结果:

messageType没有起效果,这是为什么?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你看是不是有警告信息。
要使用
v-bind:class="value|filter"的形式应该是用的2.X版本Vue吧,看下说明。传送门
class没生效,说一下你的版本