mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
fix: lint
This commit is contained in:
parent
eba1c987a8
commit
1f4514dcad
@ -74,7 +74,9 @@ export default class Renderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_renderHtml (match, content) {
|
_renderHtml (match, content) {
|
||||||
return this.html = this.html.replace(new RegExp(`<!--${match}-->`, 'g'), content)
|
this.html = this.html.replace(new RegExp(`<!--${match}-->`, 'g'), content)
|
||||||
|
|
||||||
|
return this.html
|
||||||
}
|
}
|
||||||
|
|
||||||
_render (path, type) {
|
_render (path, type) {
|
||||||
@ -83,8 +85,8 @@ export default class Renderer {
|
|||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'sidebar':
|
case 'sidebar':
|
||||||
html = this.compiler.sidebar(html, maxLevel)
|
html = this.compiler.sidebar(html, maxLevel) +
|
||||||
+ `<script>window.__SUB_SIDEBAR__ = ${JSON.stringify(
|
`<script>window.__SUB_SIDEBAR__ = ${JSON.stringify(
|
||||||
this.compiler.subSidebar(html, subMaxLevel)
|
this.compiler.subSidebar(html, subMaxLevel)
|
||||||
)}</script>`
|
)}</script>`
|
||||||
break
|
break
|
||||||
|
|||||||
@ -79,7 +79,7 @@ export function renderMixin (proto) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
proto._renderSidebar = function (text) {
|
proto._renderSidebar = function (text) {
|
||||||
const { maxLevel, subMaxLevel, autoHeader, loadSidebar } = this.config
|
const { maxLevel, subMaxLevel, loadSidebar } = this.config
|
||||||
|
|
||||||
this._renderTo('.sidebar-nav', this.compiler.sidebar(text, maxLevel))
|
this._renderTo('.sidebar-nav', this.compiler.sidebar(text, maxLevel))
|
||||||
const activeEl = getAndActive(this.router, '.sidebar-nav', true, true)
|
const activeEl = getAndActive(this.router, '.sidebar-nav', true, true)
|
||||||
@ -171,7 +171,7 @@ export function initRender (vm) {
|
|||||||
const id = config.el || '#app'
|
const id = config.el || '#app'
|
||||||
const navEl = dom.find('nav') || dom.create('nav')
|
const navEl = dom.find('nav') || dom.create('nav')
|
||||||
|
|
||||||
let el = dom.find(id)
|
const el = dom.find(id)
|
||||||
let html = ''
|
let html = ''
|
||||||
let navAppendToTarget = dom.body
|
let navAppendToTarget = dom.body
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user