这样的一种需求要怎么写呀
感觉被锁死了
多加一层会导致下面的v-for循环了好几轮
需要自己处理一下数据,v-for menuList就行了:
let menuText = ['text1', 'text2', 'text3', 'text4'];
let menuIcon = ['icon1', 'icon2', 'icon3', 'icon4'];
let menuList = [];
menuText.map((v, k) => {
menuList.push({ text: v, icon: menuIcon[k] || menuIcon[0] });
});