vue router 属性运用-共用一套view
方法1 不需要做其他处理
export default{
data(){return{}},
cteated(){
this.initPage();
},
watch :{
'$route': function (to, from) {
this.initPage();
}
},
methods:{
initPage(){
//let url = window.location.href;
let name = this.$route.meta.name;
this.exportshowFlag = false;
switch(name){
case 'collectRecordquery':
this.exportshowFlag = false;
this.resetSubmit();
break;
case 'collectRecordExp':
this.exportshowFlag = true;
this.resetSubmit();
break;
default:
this.resetSubmit();
break;
}
},
//end
}
}
方法2 需要拼接参数做权限控制
export default{
data(){return{}},
methods:{
checkAuth(url){
const menus = CommonMethod.