This repository has been archived by the owner on Jun 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 198
二级路由的组件如何加载? #36
Comments
菜单栏数据: // 左侧菜单栏数据
menuItems: [
{
name: 'home', // 要跳转的路由名称 不是路径
size: 18, // icon大小
type: 'md-home', // icon类型
text: '主页', // 文本内容
},
{
name: 'other', // 要跳转的路由名称 不是路径
size: 18, // icon大小
type: 'ios-egg-outline', // icon类型
text: '单独的路由', // 点击侧边栏跳到一个单独的路由页面,需要提前在 router.js 定义
},
{
size: 18, // icon大小
type: 'md-arrow-forward', // icon类型
text: '外链',
url: 'https://www.baidu.com',
isExternal: true, // 外链 跳到一个外部的 URL 页面
},
{
text: '二级菜单',
type: 'ios-paper',
children: [
{
type: 'ios-grid',
name: 't1',
text: '表格',
// hidden 属性 隐藏此菜单 可以通过在地址栏上输入对应的 URL 来显示页面
// hidden: true,
},
{
size: 18, // icon大小
type: 'md-arrow-forward', // icon类型
text: '外链',
url: 'https://www.baidu.com',
isExternal: true, // 外链 跳到一个外部的 URL 页面
},
{
text: '三级菜单',
type: 'ios-paper',
children: [
{
type: 'ios-notifications-outline',
name: 'msg',
text: '查看消息',
},
{
type: 'md-lock',
name: 'password',
text: '修改密码',
},
{
type: 'md-person',
name: 'userinfo',
text: '基本资料',
},
{
size: 18, // icon大小
type: 'md-arrow-forward', // icon类型
text: '外链',
url: 'https://www.baidu.com',
isExternal: true, // 外链 跳到一个外部的 URL 页面
},
],
},
],
},
], 菜单栏上的 // 本地所有的页面 需要配合后台返回的数据生成页面
export const asyncRoutes = {
home: {
path: 'home',
name: 'home',
meta: { title: '主页' },
component: () => import('../views/Home.vue'),
},
t1: {
path: 't1',
name: 't1',
meta: { title: '表格' },
component: () => import('../views/T1.vue'),
},
password: {
path: 'password',
name: 'password',
meta: { title: '修改密码' },
component: () => import('../views/Password.vue'),
},
msg: {
path: 'msg',
name: 'msg',
meta: { title: '通知消息' },
component: () => import('../views/Msg.vue'),
},
userinfo: {
path: 'userinfo',
name: 'userinfo',
meta: { title: '用户信息' },
component: () => import('../views/UserInfo.vue'),
},
} |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
tree命令输出如下:
.
├── flow
│ ├── flow.vue
│ ├── flowAnalysis.vue
│ ├── flowGather.vue
│ └── flowrestriction
│ └── ipblock
│ └── ipblock.vue
├── sniffeSettings
│ ├── config
│ │ └── tcpdump_config.vue
│ └── taskManager
│ └── tsm
│ └── tsm.vue
└── srm
└── srm.vue
The text was updated successfully, but these errors were encountered: