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

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

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

Loading…
Cancel
Save