Skip to content

Commit

Permalink
fix(render): execute script
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Feb 20, 2017
1 parent 35dd2e1 commit 780c1e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/config.js
Expand Up @@ -15,7 +15,7 @@ const config = merge({
themeColor: '',
nameLink: window.location.pathname,
autoHeader: false,
executeScript: false,
executeScript: null,
ga: ''
}, window.$docsify)

Expand Down
5 changes: 3 additions & 2 deletions src/core/render/index.js
Expand Up @@ -28,9 +28,8 @@ function renderMain (html) {
this._renderTo('.markdown-section', html)
// Render sidebar with the TOC
!this.config.loadSidebar && this._renderSidebar()
// execute script
this.config.executeScript && executeScript()

// execute script
if (this.config.executeScript !== false &&
typeof window.Vue !== 'undefined' &&
!executeScript()) {
Expand All @@ -39,6 +38,8 @@ function renderMain (html) {
vueVM && vueVM.$destroy && vueVM.$destroy()
window.__EXECUTE_RESULT__ = new window.Vue().$mount('#main')
}, 0)
} else {
this.config.executeScript && executeScript()
}

if (this.config.auto2top) {
Expand Down

0 comments on commit 780c1e5

Please sign in to comment.