fix(navbar): Now Navbar isn't append to DOM when loadNavbar is falsy (#407)

This commit is contained in:
Romain Lenzotti 2018-03-03 14:34:42 +01:00 committed by cinwell.li
parent ec8daca3ec
commit 0933445e89
2 changed files with 10 additions and 3 deletions

View File

@ -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')
}
}
}

View File

@ -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) {
@ -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(