<th colspan="2" :attr="{el.list2.length>0?colspan:rowspan:el.list2.length>0?el.list2.length:2}" class="[el.list2.length>0?'bh':'']" :for="el in @list1{{el.a}}</th>
或者
<th colspan="2" :attr="{el.list2.length>0?(colspan:el.list2.length):(rowspan:2)}" class="[el.list2.length>0?'bh':'']" :for="el in @list1{{el.a}}</th>
意思就是:attr指令中的属性可不可以用三目运算符
不要臆想这些牛逼的写法啊。。
attr接收数组或对象,你可以这么写