解决在vue+element-plus中无法同时使用v-for和v-if的问题
参考资料:
https://blog.csdn.net/Y_hhya/article/details/122191879
目的:
在vue中使用element-plus模板来遍历路由并显示在左侧导航栏中
问题:
由于路由中存在不需要遍历的数据所以像用v-if来过滤,但是报错,百度说vue不能同时使用v-if和v-for
解决方式:
详细请参考:https://blog.csdn.net/Y_hhya/article/details/122191879
computed:{
aitemList: function () {
return this.$router.options.routes.filter((item) => {
return item.hidden
})
}
}