Compare commits

..
3 Commits
Author SHA1 Message Date
qingwei.li ae1ad735d5 -> v1.10.5 2017-01-28 11:12:26 +08:00
qingwei.li a35a336d00 bump 1.10.5 2017-01-28 11:12:22 +08:00
qingwei.li 3ec7c89bbb fix initialize the Vue instance 2017-01-28 11:11:58 +08:00
6 changed files with 15 additions and 9 deletions
+4
View File
@@ -1,3 +1,7 @@
## 1.10.5
### Bug fixes
- fix initialize the Vue instance
## 1.10.4
### Bug fixes
- fix execute script
+1 -1
View File
@@ -1,6 +1,6 @@
![logo](_media/icon.svg)
# docsify <small>1.10.4</small>
# docsify <small>1.10.5</small>
> A magical documentation site generator.
+4 -3
View File
@@ -2603,12 +2603,13 @@ function renderArticle (content) {
document.body.querySelectorAll('article>script'))
.filter(function (script) { return !/template/.test(script.type); }
)[0];
var code = script ? script.innerText.trim() : null;
CACHE.vm = script
? new Function(("return " + (script.innerText.trim())))()
script && script.remove();
CACHE.vm = code
? new Function(("return " + code))()
: new Vue({ el: 'main' }); // eslint-disable-line
CACHE.vm && CACHE.vm.$nextTick(function (_) { return scrollActiveSidebar(); });
script && script.remove();
}
if (OPTIONS$1.auto2top) { setTimeout(function () { return scroll2Top(OPTIONS$1.auto2top); }, 0); }
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "docsify",
"version": "1.10.4",
"version": "1.10.5",
"description": "A magical documentation generator.",
"main": "lib/docsify.js",
"files": [
+4 -3
View File
@@ -112,12 +112,13 @@ export function renderArticle (content) {
document.body.querySelectorAll('article>script'))
.filter(script => !/template/.test(script.type)
)[0]
const code = script ? script.innerText.trim() : null
CACHE.vm = script
? new Function(`return ${script.innerText.trim()}`)()
script && script.remove()
CACHE.vm = code
? new Function(`return ${code}`)()
: new Vue({ el: 'main' }) // eslint-disable-line
CACHE.vm && CACHE.vm.$nextTick(_ => event.scrollActiveSidebar())
script && script.remove()
}
if (OPTIONS.auto2top) setTimeout(() => event.scroll2Top(OPTIONS.auto2top), 0)
}