Skip to content

Commit

Permalink
use navEl when rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Evidlo committed Jan 13, 2022
1 parent 288d05d commit 02daac4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/core/render/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,11 @@ export function Render(Base) {
}

_renderNav(text) {
text && this._renderTo('nav', this.compiler.compile(text));
text &&
this._renderTo(this.config.navEl || 'nav', this.compiler.compile(text));
if (this.config.loadNavbar) {
getAndActive(this.router, 'nav');
getAndActive(this.router, this.config.navEl || 'nav');
}

}

_renderMain(text, opt = {}, next) {
Expand Down Expand Up @@ -413,7 +413,6 @@ export function Render(Base) {
const el = dom.find(config.el || '#app');
const navEl = dom.find(config.navEl || 'nav') || dom.create('nav');

const el = dom.find(id);
let html = '';
let navAppendToTarget = dom.body;

Expand All @@ -422,7 +421,6 @@ export function Render(Base) {
html += tpl.corner(config.repo, config.cornerExternalLinkTarge);
}


if (config.coverpage) {
html += tpl.cover();
}
Expand All @@ -444,7 +442,6 @@ export function Render(Base) {
this.rendered = true;
}


if (config.mergeNavbar && isMobile && !config.navEl) {
navAppendToTarget = dom.find('.sidebar');
} else {
Expand Down

0 comments on commit 02daac4

Please sign in to comment.