Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
dafcdd89
提交
dafcdd89
authored
7月 07, 2021
作者:
Vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: ensure that safari is running properly, fix #875
上级
5bce6528
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
6 行增加
和
28 行删除
+6
-28
.eslintrc.js
.eslintrc.js
+1
-0
commitlint.config.js
commitlint.config.js
+0
-25
menuHelper.ts
src/router/helper/menuHelper.ts
+5
-3
没有找到文件。
.eslintrc.js
浏览文件 @
dafcdd89
...
@@ -61,6 +61,7 @@ module.exports = defineConfig({
...
@@ -61,6 +61,7 @@ module.exports = defineConfig({
'vue/singleline-html-element-content-newline'
:
'off'
,
'vue/singleline-html-element-content-newline'
:
'off'
,
'vue/attribute-hyphenation'
:
'off'
,
'vue/attribute-hyphenation'
:
'off'
,
'vue/require-default-prop'
:
'off'
,
'vue/require-default-prop'
:
'off'
,
'vue/script-setup-uses-vars'
:
'off'
,
'vue/html-self-closing'
:
[
'vue/html-self-closing'
:
[
'error'
,
'error'
,
{
{
...
...
commitlint.config.js
浏览文件 @
dafcdd89
module
.
exports
=
{
module
.
exports
=
{
ignores
:
[(
commit
)
=>
commit
.
includes
(
'init'
)],
ignores
:
[(
commit
)
=>
commit
.
includes
(
'init'
)],
extends
:
[
'@commitlint/config-conventional'
],
extends
:
[
'@commitlint/config-conventional'
],
parserPreset
:
{
parserOpts
:
{
headerPattern
:
/^
(\w
*|
[\u
4e00-
\u
9fa5
]
*
)(?:[\(\(](
.*
)[\)\)])?[\:\:]
(
.*
)
/
,
headerCorrespondence
:
[
'type'
,
'scope'
,
'subject'
],
referenceActions
:
[
'close'
,
'closes'
,
'closed'
,
'fix'
,
'fixes'
,
'fixed'
,
'resolve'
,
'resolves'
,
'resolved'
,
],
issuePrefixes
:
[
'#'
],
noteKeywords
:
[
'BREAKING CHANGE'
],
fieldPattern
:
/^-
(
.*
?)
-$/
,
revertPattern
:
/^Revert
\s
"
([\s\S]
*
)
"
\s
*This reverts commit
(\w
*
)\.
/
,
revertCorrespondence
:
[
'header'
,
'hash'
],
warn
()
{},
mergePattern
:
null
,
mergeCorrespondence
:
null
,
},
},
rules
:
{
rules
:
{
'body-leading-blank'
:
[
2
,
'always'
],
'body-leading-blank'
:
[
2
,
'always'
],
'footer-leading-blank'
:
[
1
,
'always'
],
'footer-leading-blank'
:
[
1
,
'always'
],
...
...
src/router/helper/menuHelper.ts
浏览文件 @
dafcdd89
...
@@ -72,14 +72,16 @@ export function transformRouteToMenu(routeModList: AppRouteModule[], routerMappi
...
@@ -72,14 +72,16 @@ export function transformRouteToMenu(routeModList: AppRouteModule[], routerMappi
/**
/**
* config menu with given params
* config menu with given params
*/
*/
const
menuParamRegex
=
/
(?
<
=
:
)([\s\S]
+
?)((?=\/)
|$
)
/g
;
const
menuParamRegex
=
/
(?
:
:
)([\s\S]
+
?)((?=\/)
|$
)
/g
;
export
function
configureDynamicParamsMenu
(
menu
:
Menu
,
params
:
RouteParams
)
{
export
function
configureDynamicParamsMenu
(
menu
:
Menu
,
params
:
RouteParams
)
{
const
{
path
,
paramPath
}
=
toRaw
(
menu
);
const
{
path
,
paramPath
}
=
toRaw
(
menu
);
let
realPath
=
paramPath
?
paramPath
:
path
;
let
realPath
=
paramPath
?
paramPath
:
path
;
const
matchArr
=
realPath
.
match
(
menuParamRegex
);
const
matchArr
=
realPath
.
match
(
menuParamRegex
);
matchArr
?.
forEach
((
it
)
=>
{
matchArr
?.
forEach
((
it
)
=>
{
if
(
params
[
it
])
{
const
realIt
=
it
.
substr
(
1
);
realPath
=
realPath
.
replace
(
`:
${
it
}
`
,
params
[
it
]
as
string
);
if
(
params
[
realIt
])
{
realPath
=
realPath
.
replace
(
`:
${
realIt
}
`
,
params
[
realIt
]
as
string
);
}
}
});
});
// save original param path.
// save original param path.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论