vuejs 列表中的元素,要动态绑定多个样式

用以下的方法 没有成功

1
:class="{ done: item.handled==1 , ignore: item.handled==2, ignore2: item.handled==3 }" >

后来发现下面的方法更稳拓些 , 也方便调整

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

:class="[gethandle_class(item.handled), getstatus_class(item.status)] ">

methods:{
...

gethandle_class: function (handle_v) {
return {
"1": "done",
"2": "ig",
"3": "ig",
}[handle_v]
},
...

}