Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
夏日掠影
vue-vben-admin
提交
cdb10cc4
V
vue-vben-admin
项目概览
夏日掠影
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cdb10cc4
编写于
6月 30, 2021
作者:
V
Vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(menu): make sure the menu is activated correctly
上级
749ba5c1
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
466 addition
and
476 deletion
+466
-476
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
package.json
package.json
+8
-7
src/components/SimpleMenu/src/SimpleMenu.vue
src/components/SimpleMenu/src/SimpleMenu.vue
+1
-2
src/router/helper/menuHelper.ts
src/router/helper/menuHelper.ts
+4
-2
src/store/modules/permission.ts
src/store/modules/permission.ts
+2
-1
yarn.lock
yarn.lock
+450
-464
未找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
cdb10cc4
...
...
@@ -13,6 +13,7 @@
-
**Icon**
修复 SvgIcon 缺少部分样式的问题
-
**LockScreen**
修复锁屏功能可以通过刷新页面或复制 URL 打开新的浏览器标签来跳过锁定状态的问题
-
修复多个窗口同时打开页面时,
`Token`
不会同步的问题
-
**Menu**
修复路由映射模式下,单级菜单刷新不会激活
## 2.5.2(2021-06-27)
...
...
package.json
浏览文件 @
cdb10cc4
...
...
@@ -39,7 +39,7 @@
"
@logicflow/extension
"
:
"
^0.5.0
"
,
"
@vueuse/core
"
:
"
^5.0.3
"
,
"
@zxcvbn-ts/core
"
:
"
^1.0.0-beta.0
"
,
"
ant-design-vue
"
:
"
2.2.0-
beta.6
"
,
"
ant-design-vue
"
:
"
2.2.0-
rc.1
"
,
"
axios
"
:
"
^0.21.1
"
,
"
codemirror
"
:
"
^5.62.0
"
,
"
cropperjs
"
:
"
^1.5.12
"
,
...
...
@@ -53,6 +53,7 @@
"
pinia
"
:
"
^2.0.0-beta.3
"
,
"
print-js
"
:
"
^1.6.0
"
,
"
qrcode
"
:
"
^1.4.4
"
,
"
resize-observer-polyfill
"
:
"
^1.5.1
"
,
"
sortablejs
"
:
"
^1.13.0
"
,
"
tinymce
"
:
"
^5.8.2
"
,
"
vditor
"
:
"
^3.8.5
"
,
...
...
@@ -66,7 +67,7 @@
"devDependencies"
:
{
"
@commitlint/cli
"
:
"
^12.1.4
"
,
"
@commitlint/config-conventional
"
:
"
^12.1.4
"
,
"
@iconify/json
"
:
"
^1.1.36
2
"
,
"
@iconify/json
"
:
"
^1.1.36
4
"
,
"
@purge-icons/generated
"
:
"
^0.7.0
"
,
"
@types/codemirror
"
:
"
^5.60.1
"
,
"
@types/crypto-js
"
:
"
^4.0.1
"
,
...
...
@@ -81,8 +82,8 @@
"
@types/qrcode
"
:
"
^1.4.0
"
,
"
@types/qs
"
:
"
^6.9.6
"
,
"
@types/sortablejs
"
:
"
^1.10.6
"
,
"
@typescript-eslint/eslint-plugin
"
:
"
^4.28.
0
"
,
"
@typescript-eslint/parser
"
:
"
^4.28.
0
"
,
"
@typescript-eslint/eslint-plugin
"
:
"
^4.28.
1
"
,
"
@typescript-eslint/parser
"
:
"
^4.28.
1
"
,
"
@vitejs/plugin-legacy
"
:
"
^1.4.3
"
,
"
@vitejs/plugin-vue
"
:
"
^1.2.4
"
,
"
@vitejs/plugin-vue-jsx
"
:
"
^1.1.6
"
,
...
...
@@ -105,7 +106,7 @@
"
husky
"
:
"
^6.0.0
"
,
"
inquirer
"
:
"
^8.1.1
"
,
"
is-ci
"
:
"
^3.0.0
"
,
"
jest
"
:
"
^27.0.
5
"
,
"
jest
"
:
"
^27.0.
6
"
,
"
less
"
:
"
^4.1.1
"
,
"
lint-staged
"
:
"
^11.0.0
"
,
"
npm-run-all
"
:
"
^4.1.5
"
,
...
...
@@ -113,7 +114,7 @@
"
prettier
"
:
"
^2.3.2
"
,
"
pretty-quick
"
:
"
^3.1.1
"
,
"
rimraf
"
:
"
^3.0.2
"
,
"
rollup-plugin-visualizer
"
:
"
5.5.
0
"
,
"
rollup-plugin-visualizer
"
:
"
5.5.
1
"
,
"
stylelint
"
:
"
^13.13.1
"
,
"
stylelint-config-prettier
"
:
"
^8.0.2
"
,
"
stylelint-config-standard
"
:
"
^22.0.0
"
,
...
...
@@ -122,7 +123,7 @@
"
ts-jest
"
:
"
^27.0.3
"
,
"
ts-node
"
:
"
^10.0.0
"
,
"
typescript
"
:
"
4.3.4
"
,
"
vite
"
:
"
2.
3.8
"
,
"
vite
"
:
"
2.
4.0-beta.2
"
,
"
vite-plugin-compression
"
:
"
^0.2.5
"
,
"
vite-plugin-html
"
:
"
^2.0.7
"
,
"
vite-plugin-imagemin
"
:
"
^0.3.2
"
,
...
...
src/components/SimpleMenu/src/SimpleMenu.vue
浏览文件 @
cdb10cc4
...
...
@@ -21,10 +21,8 @@
import
type
{
MenuState
}
from
'
./types
'
;
import
type
{
Menu
as
MenuType
}
from
'
/@/router/types
'
;
import
type
{
RouteLocationNormalizedLoaded
}
from
'
vue-router
'
;
import
{
defineComponent
,
computed
,
ref
,
unref
,
reactive
,
toRefs
,
watch
}
from
'
vue
'
;
import
{
useDesign
}
from
'
/@/hooks/web/useDesign
'
;
import
Menu
from
'
./components/Menu.vue
'
;
import
SimpleSubMenu
from
'
./SimpleSubMenu.vue
'
;
import
{
listenerRouteChange
}
from
'
/@/logics/mitt/routeChange
'
;
...
...
@@ -123,6 +121,7 @@
return
;
}
const
path
=
(
route
||
unref
(
currentRoute
)).
path
;
menuState
.
activeName
=
path
;
setOpenKeys
(
path
);
...
...
src/router/helper/menuHelper.ts
浏览文件 @
cdb10cc4
import
{
AppRouteModule
}
from
'
/@/router/types
'
;
import
type
{
MenuModule
,
Menu
,
AppRouteRecordRaw
}
from
'
/@/router/types
'
;
import
{
findPath
,
treeMap
}
from
'
/@/utils/helper/treeHelper
'
;
import
{
cloneDeep
}
from
'
lodash-es
'
;
import
{
isUrl
}
from
'
/@/utils/is
'
;
...
...
@@ -36,11 +35,14 @@ export function transformMenuModule(menuModule: MenuModule): Menu {
return
menuList
[
0
];
}
export
function
transformRouteToMenu
(
routeModList
:
AppRouteModule
[])
{
export
function
transformRouteToMenu
(
routeModList
:
AppRouteModule
[]
,
routerMapping
=
false
)
{
const
cloneRouteModList
=
cloneDeep
(
routeModList
);
const
routeList
:
AppRouteRecordRaw
[]
=
[];
cloneRouteModList
.
forEach
((
item
)
=>
{
if
(
routerMapping
&&
item
.
meta
.
hideChildrenInMenu
&&
typeof
item
.
redirect
===
'
string
'
)
{
item
.
path
=
item
.
redirect
;
}
if
(
item
.
meta
?.
single
)
{
const
realItem
=
item
?.
children
?.[
0
];
realItem
&&
routeList
.
push
(
realItem
);
...
...
src/store/modules/permission.ts
浏览文件 @
cdb10cc4
...
...
@@ -122,10 +122,11 @@ export const usePermissionStore = defineStore({
case
PermissionModeEnum
.
ROUTE_MAPPING
:
routes
=
filter
(
asyncRoutes
,
routeFilter
);
routes
=
routes
.
filter
(
routeFilter
);
const
menuList
=
transformRouteToMenu
(
asyncRoutes
);
const
menuList
=
transformRouteToMenu
(
asyncRoutes
,
true
);
menuList
.
sort
((
a
,
b
)
=>
{
return
(
a
.
meta
?.
orderNo
||
0
)
-
(
b
.
meta
?.
orderNo
||
0
);
});
this
.
setFrontMenuList
(
menuList
);
// Convert multi-level routing to level 2 routing
routes
=
flatMultiLevelRoutes
(
routes
);
...
...
yarn.lock
浏览文件 @
cdb10cc4
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录