Browse Source

优化菜单栏

master
ltlzx 4 years ago
parent
commit
0d575e93f2
  1. 32
      src/components/Sidebar.vue

32
src/components/Sidebar.vue

@ -94,19 +94,29 @@ export default {
}, },
created(){ created(){
this.key=this.$route.path this.key=this.$route.path
this.items.map(item=>{ this.showMenu()
if(item.children){ },
for(let item1 in item.children){ methods:{
if(item1.key==this.key){ showMenu(){
this.openKey=item.key this.items.map(item=>{
break if(item.children){
}else{ for(let i in item.children){
this.openKey='' let item1=item.children[i]
this.key='' if(item1.key==this.key){
this.openKey=item.key
break
}
} }
} }
} })
}) },
},
watch:{
$route(to,form){
// console.info(to)
// this.key=to.path
// this.showMenu()
}
} }
} }
</script> </script>

Loading…
Cancel
Save