fix(compiler): force reset toc when rendering sidebar fixed #181

This commit is contained in:
qingwei.li 2017-06-02 22:12:07 +08:00
commit ccf4c7c5cc
No known key found for this signature in database
GPG key ID: B6DDC2F7AE80B2F4
2 changed files with 7 additions and 0 deletions

View file

@ -85,6 +85,9 @@ export function renderMixin (proto) {
const activeEl = getAndActive(this.router, '.sidebar-nav', true, true)
if (loadSidebar && activeEl) {
activeEl.parentNode.innerHTML += this.compiler.subSidebar(subMaxLevel)
} else {
// reset toc
this.compiler.subSidebar()
}
// bind event
this._bindEventOnRendered()