[build] 4.1.9

This commit is contained in:
qingwei.li
2017-05-31 22:32:30 +08:00
parent 56c7b9ae2d
commit 841829427b
5 changed files with 11 additions and 12 deletions

View File

@@ -126,23 +126,22 @@ function initLifecycle (vm) {
function callHook (vm, hook, data, next) {
if ( next === void 0 ) next = noop;
var newData = data;
var queue = vm._hooks[hook];
var step = function (index) {
var hook = queue[index];
if (index >= queue.length) {
next(newData);
next(data);
} else {
if (typeof hook === 'function') {
if (hook.length === 2) {
hook(data, function (result) {
newData = result;
data = result;
step(index + 1);
});
} else {
var result = hook(data);
newData = result !== undefined ? result : newData;
data = result !== undefined ? result : data;
step(index + 1);
}
} else {
@@ -2797,8 +2796,8 @@ Compiler.prototype._initRenderer = function _initRenderer () {
var ref = this;
var linkTarget = ref.linkTarget;
var router = ref.router;
var toc = ref.toc;
var contentBase = ref.contentBase;
var _self = this;
/**
* render anchor tag
* @link https://github.com/chjj/marked#overriding-renderer-methods
@@ -2821,7 +2820,7 @@ Compiler.prototype._initRenderer = function _initRenderer () {
var slug = slugify(text);
var url = router.toURL(router.getCurrentPath(), { id: slug });
nextToc.slug = url;
toc.push(nextToc);
_self.toc.push(nextToc);
return ("<h" + level + " id=\"" + slug + "\"><a href=\"" + url + "\" data-id=\"" + slug + "\" class=\"anchor\"><span>" + text + "</span></a></h" + level + ">")
};
@@ -3288,6 +3287,7 @@ function initRender (vm) {
// Polyfll
cssVars(config.themeColor);
}
vm._updateRender();
toggleClass(body, 'ready');
}
@@ -3544,7 +3544,6 @@ function initRouter (vm) {
router.normalize();
lastRoute = vm.route = router.parse();
vm._updateRender();
router.onchange(function (_) {
router.normalize();