Skip to content

Commit 0933445

Browse files
RomakitaQingWei-Li
authored andcommitted
fix(navbar): Now Navbar isn't append to DOM when loadNavbar is falsy (#407)
1 parent ec8daca commit 0933445

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Diff for: src/core/event/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import { scrollIntoView } from './scroll'
66
export function eventMixin (proto) {
77
proto.$resetEvents = function () {
88
scrollIntoView(this.route.path, this.route.query.id)
9-
sidebar.getAndActive(this.router, 'nav')
9+
10+
if (this.config.loadNavbar) {
11+
sidebar.getAndActive(this.router, 'nav')
12+
}
1013
}
1114
}
1215

Diff for: src/core/render/index.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ export function renderMixin (proto) {
117117

118118
proto._renderNav = function (text) {
119119
text && this._renderTo('nav', this.compiler.compile(text))
120-
getAndActive(this.router, 'nav')
120+
if (this.config.loadNavbar) {
121+
getAndActive(this.router, 'nav')
122+
}
121123
}
122124

123125
proto._renderMain = function (text, opt = {}, next) {
@@ -238,7 +240,9 @@ export function initRender (vm) {
238240
}
239241

240242
// Add nav
241-
dom.before(navAppendToTarget, navEl)
243+
if (config.loadNavbar) {
244+
dom.before(navAppendToTarget, navEl)
245+
}
242246

243247
if (config.themeColor) {
244248
dom.$.head.appendChild(

0 commit comments

Comments
 (0)