标签:imp 获取 用户信息 2-2 渲染 nes 后端 返回 token
主要思路如下:
1、在src/router文件夹下新建_import.js,用于匹配组件,代码如下:
export default file => { return map[file] || null } const map = { ‘Layout‘: () => import(‘@/layout‘), ‘table‘: () => import(‘@/views/table/index‘), ‘tree‘: () => import(‘@/views/tree/index‘), ‘form‘: () => import(‘@/views/form/index‘), ‘menu1‘: () => import(‘@/views/nested/menu1/index‘), ‘menu1-1‘: () => import(‘@/views/nested/menu1/menu1-1‘), ‘menu1-2‘: () => import(‘@/views/nested/menu1/menu1-2‘), ‘menu1-2-1‘: () => import(‘@/views/nested/menu1/menu1-2/menu1-2-1‘), ‘menu1-2-2‘: () => import(‘@/views/nested/menu1/menu1-2/menu1-2-2‘), ‘menu1-3‘: () => import(‘@/views/nested/menu1/menu1-3‘), ‘menu2‘: () => import(‘@/views/nested/menu2/index‘) }
vue-element-template实战(五) 获取后端路由表动态生成权限
标签:imp 获取 用户信息 2-2 渲染 nes 后端 返回 token
原文地址:https://www.cnblogs.com/windok/p/13195268.html