computed传参
2020-04-24 本文已影响0人
前端又又
在特有的需要对两个数组循环进行比较判断,但是又不能同时使用v-for和v-if,这时候就可以使用computed。
<span v-for="(item,index) in getRoleList(row.roleType)" :key="index">{{ item.name }}</span>
![](https://img.haomeiwen.com/i18902341/2ea42b5dcd7d2fbf.png)
在特有的需要对两个数组循环进行比较判断,但是又不能同时使用v-for和v-if,这时候就可以使用computed。
<span v-for="(item,index) in getRoleList(row.roleType)" :key="index">{{ item.name }}</span>