Skip to content

Commit

Permalink
fix(navbar): Now Navbar isn't append to DOM when loadNavbar is falsy (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita authored and QingWei-Li committed Mar 3, 2018
1 parent ec8daca commit 0933445
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/core/event/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { scrollIntoView } from './scroll'
export function eventMixin (proto) {
proto.$resetEvents = function () {
scrollIntoView(this.route.path, this.route.query.id)
sidebar.getAndActive(this.router, 'nav')

if (this.config.loadNavbar) {
sidebar.getAndActive(this.router, 'nav')
}
}
}

Expand Down
8 changes: 6 additions & 2 deletions src/core/render/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ export function renderMixin (proto) {

proto._renderNav = function (text) {
text && this._renderTo('nav', this.compiler.compile(text))
getAndActive(this.router, 'nav')
if (this.config.loadNavbar) {
getAndActive(this.router, 'nav')
}
}

proto._renderMain = function (text, opt = {}, next) {
Expand Down Expand Up @@ -238,7 +240,9 @@ export function initRender (vm) {
}

// Add nav
dom.before(navAppendToTarget, navEl)
if (config.loadNavbar) {
dom.before(navAppendToTarget, navEl)
}

if (config.themeColor) {
dom.$.head.appendChild(
Expand Down

0 comments on commit 0933445

Please sign in to comment.