Skip to content

Commit 780c1e5

Browse files
committed
fix(render): execute script
1 parent 35dd2e1 commit 780c1e5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/core/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const config = merge({
1515
themeColor: '',
1616
nameLink: window.location.pathname,
1717
autoHeader: false,
18-
executeScript: false,
18+
executeScript: null,
1919
ga: ''
2020
}, window.$docsify)
2121

src/core/render/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ function renderMain (html) {
2828
this._renderTo('.markdown-section', html)
2929
// Render sidebar with the TOC
3030
!this.config.loadSidebar && this._renderSidebar()
31-
// execute script
32-
this.config.executeScript && executeScript()
3331

32+
// execute script
3433
if (this.config.executeScript !== false &&
3534
typeof window.Vue !== 'undefined' &&
3635
!executeScript()) {
@@ -39,6 +38,8 @@ function renderMain (html) {
3938
vueVM && vueVM.$destroy && vueVM.$destroy()
4039
window.__EXECUTE_RESULT__ = new window.Vue().$mount('#main')
4140
}, 0)
41+
} else {
42+
this.config.executeScript && executeScript()
4243
}
4344

4445
if (this.config.auto2top) {

0 commit comments

Comments
 (0)