fix(render): execute script
This commit is contained in:
parent
35dd2e16fa
commit
780c1e580e
2 changed files with 4 additions and 3 deletions
|
|
@ -15,7 +15,7 @@ const config = merge({
|
||||||
themeColor: '',
|
themeColor: '',
|
||||||
nameLink: window.location.pathname,
|
nameLink: window.location.pathname,
|
||||||
autoHeader: false,
|
autoHeader: false,
|
||||||
executeScript: false,
|
executeScript: null,
|
||||||
ga: ''
|
ga: ''
|
||||||
}, window.$docsify)
|
}, window.$docsify)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,8 @@ function renderMain (html) {
|
||||||
this._renderTo('.markdown-section', html)
|
this._renderTo('.markdown-section', html)
|
||||||
// Render sidebar with the TOC
|
// Render sidebar with the TOC
|
||||||
!this.config.loadSidebar && this._renderSidebar()
|
!this.config.loadSidebar && this._renderSidebar()
|
||||||
// execute script
|
|
||||||
this.config.executeScript && executeScript()
|
|
||||||
|
|
||||||
|
// execute script
|
||||||
if (this.config.executeScript !== false &&
|
if (this.config.executeScript !== false &&
|
||||||
typeof window.Vue !== 'undefined' &&
|
typeof window.Vue !== 'undefined' &&
|
||||||
!executeScript()) {
|
!executeScript()) {
|
||||||
|
|
@ -39,6 +38,8 @@ function renderMain (html) {
|
||||||
vueVM && vueVM.$destroy && vueVM.$destroy()
|
vueVM && vueVM.$destroy && vueVM.$destroy()
|
||||||
window.__EXECUTE_RESULT__ = new window.Vue().$mount('#main')
|
window.__EXECUTE_RESULT__ = new window.Vue().$mount('#main')
|
||||||
}, 0)
|
}, 0)
|
||||||
|
} else {
|
||||||
|
this.config.executeScript && executeScript()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.config.auto2top) {
|
if (this.config.auto2top) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue