提交 f370f896 编写于 作者: Q qiang

fix: 95628713

上级 85d2f0b2
......@@ -5813,7 +5813,7 @@ function getTarget(obj, path) {
function internalMixin(Vue) {
Vue.config.errorHandler = function(err, vm, info) {
Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
console.error(err);
/* eslint-disable no-undef */
var app = getApp();
......@@ -5928,7 +5928,7 @@ function internalMixin(Vue) {
};
Vue.prototype.__map = function(val, iteratee) {
//TODO 暂不考虑 string,number
//TODO 暂不考虑 string
var ret, i, l, keys, key;
if (Array.isArray(val)) {
ret = new Array(val.length);
......@@ -5944,6 +5944,13 @@ function internalMixin(Vue) {
ret[key] = iteratee(val[key], key, i);
}
return ret
} else if (typeof val === 'number') {
ret = new Array(val);
for (i = 0, l = val; i < l; i++) {
// 第一个参数暂时仍和小程序一致
ret[i] = iteratee(i, i);
}
return ret
}
return []
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册