9.16/1
This commit is contained in:
@@ -88,6 +88,10 @@ const looseToNumber = (val) => {
|
||||
const n = parseFloat(val);
|
||||
return isNaN(n) ? val : n;
|
||||
};
|
||||
const toNumber = (val) => {
|
||||
const n = isString(val) ? Number(val) : NaN;
|
||||
return isNaN(n) ? val : n;
|
||||
};
|
||||
const toDisplayString = (val) => {
|
||||
return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
|
||||
};
|
||||
@@ -5094,10 +5098,32 @@ function vFor(source, renderItem) {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
function withModelModifiers(fn, { number, trim }, isComponent = false) {
|
||||
if (isComponent) {
|
||||
return (...args) => {
|
||||
if (trim) {
|
||||
args = args.map((a) => a.trim());
|
||||
} else if (number) {
|
||||
args = args.map(toNumber);
|
||||
}
|
||||
return fn(...args);
|
||||
};
|
||||
}
|
||||
return (event) => {
|
||||
const value = event.detail.value;
|
||||
if (trim) {
|
||||
event.detail.value = value.trim();
|
||||
} else if (number) {
|
||||
event.detail.value = toNumber(value);
|
||||
}
|
||||
return fn(event);
|
||||
};
|
||||
}
|
||||
const o = (value, key) => vOn(value, key);
|
||||
const f = (source, renderItem) => vFor(source, renderItem);
|
||||
const e = (target, ...sources) => extend(target, ...sources);
|
||||
const t = (val) => toDisplayString(val);
|
||||
const m = (fn, modifiers, isComponent = false) => withModelModifiers(fn, modifiers, isComponent);
|
||||
function createApp$1(rootComponent, rootProps = null) {
|
||||
rootComponent && (rootComponent.mpType = "app");
|
||||
return createVueApp(rootComponent, rootProps).use(plugin);
|
||||
@@ -7870,6 +7896,7 @@ exports.createSSRApp = createSSRApp;
|
||||
exports.e = e;
|
||||
exports.f = f;
|
||||
exports.index = index;
|
||||
exports.m = m;
|
||||
exports.o = o;
|
||||
exports.t = t;
|
||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map
|
||||
|
||||
Reference in New Issue
Block a user