let routerUrl = ['/delivery','/fund','/marketing'];
let list = [
{
path: '/member',
icon: 'person',
name: 'member',
title: '会员',
component: Main
},
{
path: '/product',
icon: 'pricetag',
name: 'product',
title: '商品',
component: Main
},
{
path: '/delivery',
icon: 'navigate',
name: 'delivery',
title: '同城配送',
component: Main
},
{
path: '/order',
icon: 'ios-list',
name: 'order',
title: '订单',
component: Main
},
{
path: '/fund',
icon: 'social-yen',
name: 'fund',
title: '资金',
component: Main
},
{
path: '/marketing',
icon: 'playstation',
name: 'marketing',
title: '营销推广',
component: Main
},
{
path: '/analysis',
icon: 'stats-bars',
name: 'analysis',
title: '统计分析',
component: Main
}
];
// 去掉 id 等于 2 的数据
for(let j =0; j<=routerUrl.length; j++){
for (let i = 0; i < list.length; i++) {
if (list[i].path == routerUrl[j]) {
list.splice(i, 1);
break; // list[i].path 的值 等于routerUrl[j]时 不能break
}
}
}
console.log(list);
最后显示:会员、商品、订单、运营数据;
网友评论