动态路由初始化前端
This commit is contained in:
9
QMPlusVuePage/src/utils/asyncRouter.js
Normal file
9
QMPlusVuePage/src/utils/asyncRouter.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const _import = require('./_import') //获取组件的方法
|
||||
export const asyncRouterHandle = (asyncRouter) => {
|
||||
asyncRouter.map(item => {
|
||||
item.component = _import(item.component)
|
||||
if (item.children) {
|
||||
asyncRouterHandle(item.children)
|
||||
}
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user