New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
点侧边栏展开父级别菜单展开或者伸缩的时候 其他菜单一起伸缩 不是单个伸缩或者展开 #2367
Comments
tiantian998
changed the title
点侧边栏展开击父级别菜单展开或者伸缩的时候 其他菜单一起伸缩 不是单个伸缩或者展开
点侧边栏展开父级别菜单展开或者伸缩的时候 其他菜单一起伸缩 不是单个伸缩或者展开
Jul 11, 2019
希望得到解决 |
直觉告诉我 sidebarItem写的有问题吧 看不到 sidebarItem html |
问题解决了
…------------------ 原始邮件 ------------------
发件人: "297087852"<notifications@github.com>;
发送时间: 2019年7月17日(星期三) 上午10:13
收件人: "PanJiaChen/vue-element-admin"<vue-element-admin@noreply.github.com>;
抄送: "胜多负少地方"<2212427890@qq.com>; "Author"<author@noreply.github.com>;
主题: Re: [PanJiaChen/vue-element-admin] 点侧边栏展开父级别菜单展开或者伸缩的时候 其他菜单一起伸缩 不是单个伸缩或者展开 (#2367)
直觉告诉我 sidebarItem写的有问题吧 看不到 sidebarItem html
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
感谢作者的回复
…------------------ 原始邮件 ------------------
发件人: "297087852"<notifications@github.com>;
发送时间: 2019年7月17日(星期三) 上午10:13
收件人: "PanJiaChen/vue-element-admin"<vue-element-admin@noreply.github.com>;
抄送: "胜多负少地方"<2212427890@qq.com>; "Author"<author@noreply.github.com>;
主题: Re: [PanJiaChen/vue-element-admin] 点侧边栏展开父级别菜单展开或者伸缩的时候 其他菜单一起伸缩 不是单个伸缩或者展开 (#2367)
直觉告诉我 sidebarItem写的有问题吧 看不到 sidebarItem html
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
请问是如何解决的?可以分享一下吗 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
点侧边栏展开击父级别菜单展开或者伸缩的时候 其他菜单一起伸缩 不是单个伸缩或者展开
:unique-opened="false" 或者 :unique-opened="true" 都没有用
Screenshot or Gif(截图或动态图)
而且点击顶部收缩菜单后 点击展示不出全部对应的菜单
我的后台编写 Sidebar.vue 页面
自己编写的SidebarItem.vue
登陆的时候分配菜单
store获取菜单
动态生成菜单的方法
export function filterAsyncRouter(asyncRouterMap) {
// 注意这里的 asyncRouterMap 是一个数组
const accessedRouters = asyncRouterMap.filter(route => {
if (route.path) {
if (route.path === '-') {
// Layout组件特殊处理
route.component = Layout
route.path = ''
} else {
try {
route.component = _import(route.path)
} catch (e) {
console.info('%c 当前路由 ' + route.path + '.vue 不存在,因此如法导入组件,请检查接口数据和组件是否匹配,并重新登录,清空缓存!', 'color:red')
}
}
}
if (route.children && route.children.length) {
route.children = filterAsyncRouter(route.children)
}
return true
})
return accessedRouters
}
我自己生成的菜单json格式
[{
"id": 2,
"pid": 0,
"order": 0,
"name": "系统管理",
"hidden": false,
"path": "-",
"meta": {
"title": "系统管理",
"icon": "component",
"requireAuth": true,
"NoTabPage": false
},
"children": [{
"id": 3,
"pid": 2,
"order": 1,
"name": "用户管理",
"hidden": false,
"path": "/users/index",
"meta": {
"title": "用户管理",
"icon": "",
"requireAuth": true,
"NoTabPage": false
},
"children": null
}, {
"id": 6,
"pid": 2,
"order": 2,
"name": "角色管理",
"hidden": false,
"path": "/roles/index",
"meta": {
"title": "角色管理",
"icon": null,
"requireAuth": true,
"NoTabPage": false
},
"children": null
}, {
"id": 1030,
"pid": 2,
"order": 3,
"name": "组织机构",
"hidden": false,
"path": "/organizations/index",
"meta": {
"title": "组织机构",
"icon": "",
"requireAuth": true,
"NoTabPage": false
},
"children": null
}, {
"id": 8,
"pid": 2,
"order": 4,
"name": "接口管理",
"hidden": false,
"path": "/modules/index",
"meta": {
"title": "接口管理",
"icon": null,
"requireAuth": true,
"NoTabPage": false
},
"children": null
}, {
"id": 26,
"pid": 2,
"order": 5,
"name": "图标管理",
"hidden": false,
"path": "/icons/index",
"meta": {
"title": "图标管理",
"icon": "",
"requireAuth": true,
"NoTabPage": false
},
"children": null
}, {
"id": 15,
"pid": 2,
"order": 6,
"name": "菜单管理",
"hidden": false,
"path": "/permission/index",
"meta": {
"title": "菜单管理",
"icon": "",
"requireAuth": true,
"NoTabPage": false
},
"children": null
}, {
"id": 16,
"pid": 2,
"order": 7,
"name": "分配权限",
"hidden": false,
"path": "/permission/assign",
"meta": {
"title": "分配权限",
"icon": "",
"requireAuth": true,
"NoTabPage": false
},
"children": null
}]
}, {
"id": 1040,
"pid": 0,
"order": 0,
"name": "产品管理",
"hidden": false,
"path": "-",
"meta": {
"title": "产品管理",
"icon": "component",
"requireAuth": true,
"NoTabPage": false
},
"children": [{
"id": 1042,
"pid": 1040,
"order": 0,
"name": "sdsdfdfssdf",
"hidden": false,
"path": "/category/index",
"meta": {
"title": "sdsdfdfssdf",
"icon": "",
"requireAuth": true,
"NoTabPage": false
},
"children": null
}, {
"id": 1043,
"pid": 1040,
"order": 0,
"name": "sfsdfsdfsdfsdf",
"hidden": false,
"path": "/categoy/index",
"meta": {
"title": "sfsdfsdfsdfsdf",
"icon": "",
"requireAuth": true,
"NoTabPage": false
},
"children": null
}]
}]
The text was updated successfully, but these errors were encountered: