d2admin/page/init

Former-commit-id: 0fd794e5361859434b21a1cc49e2d72f489f5de0 [formerly 0fd794e5361859434b21a1cc49e2d72f489f5de0 [formerly 0fd794e5361859434b21a1cc49e2d72f489f5de0 [formerly 0fd794e5361859434b21a1cc49e2d72f489f5de0 [formerly d72d1e502f4b303799f630b8237dc216f72a7633 [formerly 157500ee60819d56bbb9b3f882cceae092d59894]]]]]
Former-commit-id: ded1d89da759f04bcf3d61f170b9112248a60042
Former-commit-id: b018fb280b8677482c7b025683fac80b409c45a8
Former-commit-id: 8541a3fba946b54cae9766ffb0544619a82e3567 [formerly caf5ea8972da4c79e5a4f3198bed949bb4dee38d]
Former-commit-id: bdb47e4a3a6b9f2dba19477fc4f9b71f7c3de8f6
Former-commit-id: 8142c4a779c57e7c611ebbaf433473e3be38f142
Former-commit-id: 6f553015bf1b25ff7e32876949ee6bf6e891434f
Former-commit-id: cab17f36b8c0121898fcf6c8286620426be42d04
Former-commit-id: 3a194a2c9cd3044ea1ab6ae2f7c29d5a6f105ae2
This commit is contained in:
liyang
2018-08-22 08:52:25 +08:00
parent a5afbdd276
commit 3704f6b682
3 changed files with 16 additions and 24 deletions

View File

@@ -48,7 +48,7 @@ new Vue({
render: h => h(App),
created () {
// 处理路由 得到每一级的路由设置
this.getAllPageFromRoutes()
this.$store.commit('d2admin/page/init', frameInRoutes)
// 设置顶栏菜单
this.$store.commit('d2admin/menu/headerSet', menuHeader)
},
@@ -70,25 +70,5 @@ new Vue({
const _side = menuAside.filter(menu => menu.path === val[0].path)
this.$store.commit('d2admin/menu/asideSet', _side.length > 0 ? _side[0].children : [])
}
},
methods: {
/**
* 处理路由 得到所有的页面
*/
getAllPageFromRoutes () {
const pool = []
const push = function (routes) {
routes.forEach(route => {
if (route.children) {
push(route.children)
} else {
const { meta, name, path } = route
pool.push({ meta, name, path })
}
})
}
push(frameInRoutes)
this.$store.commit('d2admin/page/poolSet', pool)
}
}
}).$mount('#app')