Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
dafcdd89
Commit
dafcdd89
authored
Jul 07, 2021
by
Vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: ensure that safari is running properly, fix #875
parent
5bce6528
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
28 deletions
+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
No files found.
.eslintrc.js
View file @
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
View file @
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
View file @
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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment