Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apaas-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gzga-jzapi
apaas-ui
Commits
da510826
Commit
da510826
authored
Nov 03, 2020
by
张俊
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
https://cloud.wodcloud.com/git/apaas/apaas-v3-ui
into dev
parents
ae34d208
2e855906
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
src/components/doc-width-nav.vue
src/components/doc-width-nav.vue
+8
-4
No files found.
src/components/doc-width-nav.vue
View file @
da510826
...
@@ -89,23 +89,23 @@ export default {
...
@@ -89,23 +89,23 @@ export default {
level
=
1
;
level
=
1
;
id
=
`nav_
${
pre_h1_index
}
_
${
time
}
`
;
id
=
`nav_
${
pre_h1_index
}
_
${
time
}
`
;
newTitle
=
title
.
replace
(
/<h1/g
,
`<h1 id="
${
id
}
"`
);
newTitle
=
title
.
replace
(
"
<h1
"
,
`<h1 id="
${
id
}
"`
);
}
else
if
(
title
.
match
(
/<h2
(([\s\S])
*
?)
<
\/
h2>/g
))
{
}
else
if
(
title
.
match
(
/<h2
(([\s\S])
*
?)
<
\/
h2>/g
))
{
pre_h2_index
++
;
pre_h2_index
++
;
pre_h3_index
=
0
;
pre_h3_index
=
0
;
level
=
2
;
level
=
2
;
id
=
`nav_
${
pre_h1_index
}
_
${
pre_h2_index
}
_
${
time
}
`
;
id
=
`nav_
${
pre_h1_index
}
_
${
pre_h2_index
}
_
${
time
}
`
;
newTitle
=
title
.
replace
(
/<h2/g
,
`<h2 id="
${
id
}
"`
);
newTitle
=
title
.
replace
(
"
<h2
"
,
`<h2 id="
${
id
}
"`
);
}
else
if
(
title
.
match
(
/<h3
(([\s\S])
*
?)
<
\/
h3>/g
))
{
}
else
if
(
title
.
match
(
/<h3
(([\s\S])
*
?)
<
\/
h3>/g
))
{
pre_h3_index
++
;
pre_h3_index
++
;
level
=
3
;
level
=
3
;
id
=
`nav_
${
pre_h1_index
}
_
${
pre_h2_index
}
_
${
pre_h3_index
}
_
${
time
}
`
;
id
=
`nav_
${
pre_h1_index
}
_
${
pre_h2_index
}
_
${
pre_h3_index
}
_
${
time
}
`
;
newTitle
=
title
.
replace
(
/<h3/g
,
`<h3 id="
${
id
}
"`
);
newTitle
=
title
.
replace
(
"
<h3
"
,
`<h3 id="
${
id
}
"`
);
}
}
content
=
content
.
replace
(
new
RegExp
(
title
)
,
newTitle
);
content
=
content
.
replace
(
title
,
newTitle
);
return
{
return
{
level
,
level
,
...
@@ -127,6 +127,10 @@ export default {
...
@@ -127,6 +127,10 @@ export default {
this
.
curNav
=
item
.
id
;
this
.
curNav
=
item
.
id
;
},
},
setScroll
(
el
,
parentEl
)
{
setScroll
(
el
,
parentEl
)
{
if
(
!
el
||
!
parentEl
)
{
return
;
}
let
actualTop
=
el
.
offsetTop
;
let
actualTop
=
el
.
offsetTop
;
let
current
=
el
.
offsetParent
;
let
current
=
el
.
offsetParent
;
...
...
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