fix(render): Toc rendering error, fixed #106
This commit is contained in:
parent
0aead898eb
commit
0d59ee939f
2 changed files with 3 additions and 2 deletions
|
|
@ -106,8 +106,9 @@ export function sidebar (text, level) {
|
|||
html = markdown(text)
|
||||
html = html.match(/<ul[^>]*>([\s\S]+)<\/ul>/g)[0]
|
||||
} else {
|
||||
const tree = genTree(toc, level)
|
||||
const tree = cacheTree[currentPath] || genTree(toc, level)
|
||||
html = treeTpl(tree, '<ul>')
|
||||
cacheTree[currentPath] = tree
|
||||
}
|
||||
|
||||
return html
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ export function renderMixin (proto) {
|
|||
|
||||
this._renderTo('.sidebar-nav', sidebar(text, maxLevel))
|
||||
const active = getAndActive('.sidebar-nav', true, true)
|
||||
loadSidebar && subSidebar(active, subMaxLevel)
|
||||
subSidebar(loadSidebar ? active : '', subMaxLevel)
|
||||
// bind event
|
||||
this.activeLink = active
|
||||
scrollActiveSidebar()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue