Browse Source

左侧菜单栏实现

master
wen 2 years ago
parent
commit
85dcbaf616
  1. 16
      src/layout/components/Sidebar/index.vue
  2. 1
      src/layout/components/Sidebar/leftMenusData.js

16
src/layout/components/Sidebar/index.vue

@ -33,11 +33,12 @@ export default { @@ -33,11 +33,12 @@ export default {
components: { SidebarItem, Logo },
created: function () {
this.getmunusdata();
this.menusdatas = 66
//this.menusdatas = ''
var fe = 10;
},
data() {
return {
//routes:this.menusdatas
routes:menusdata
}
},
computed: {
@ -88,10 +89,10 @@ export default { @@ -88,10 +89,10 @@ export default {
}
arrMenus.push(newMenu);
console.log(arrMenus);
return arrMenus;
//console.log(arrMenus);
});
return arrMenus;
},
getmunusdata() {
@ -104,8 +105,9 @@ export default { @@ -104,8 +105,9 @@ export default {
//routesData(datamain.data.menus);
//console.log(response);
console.log(this.menusdatas);
this.menusdatas = this.SplicingMenuTree(datamain.data.menus);
console.log(this.menusdatas);
menusdata[0].children = this.SplicingMenuTree(datamain.data.menus);
//menusdatas[0] = addmunst
console.log(menusdata);
//this.routes = menusdata
//console.log(menusdata);

1
src/layout/components/Sidebar/leftMenusData.js

@ -31,6 +31,7 @@ var menusdata = [ @@ -31,6 +31,7 @@ var menusdata = [
id: '0',
path: '/filemange',
meta: { title: '文件管理', icon: 'dashboard' },
children:[]
},
{
path: '/usermange',

Loading…
Cancel
Save