This commit is contained in:
pengxiaolong
2025-05-12 22:19:21 +08:00
parent 033cb649f8
commit c45c7c4de1
33 changed files with 322 additions and 58 deletions

View File

@@ -85,9 +85,29 @@ const def = (obj, key, value) => {
});
};
const looseToNumber = (val) => {
const n = parseFloat(val);
return isNaN(n) ? val : n;
const n2 = parseFloat(val);
return isNaN(n2) ? val : n2;
};
function normalizeClass(value) {
let res = "";
if (isString(value)) {
res = value;
} else if (isArray(value)) {
for (let i = 0; i < value.length; i++) {
const normalized = normalizeClass(value[i]);
if (normalized) {
res += normalized + " ";
}
}
} else if (isObject(value)) {
for (const name in value) {
if (value[name]) {
res += name + " ";
}
}
}
return res.trim();
}
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);
};
@@ -5132,6 +5152,7 @@ function vFor(source, renderItem) {
const o = (value, key) => vOn(value, key);
const f = (source, renderItem) => vFor(source, renderItem);
const e = (target, ...sources) => extend(target, ...sources);
const n = (value) => normalizeClass(value);
const t = (val) => toDisplayString(val);
function createApp$1(rootComponent, rootProps = null) {
rootComponent && (rootComponent.mpType = "app");
@@ -5723,8 +5744,8 @@ const $once = defineSyncApi(API_ONCE, (name, callback) => {
const $off = defineSyncApi(API_OFF, (name, callback) => {
if (!isArray(name))
name = name ? [name] : [];
name.forEach((n) => {
eventBus.off(n, callback);
name.forEach((n2) => {
eventBus.off(n2, callback);
});
}, OffProtocol);
const $emit = defineSyncApi(API_EMIT, (name, ...args) => {
@@ -7905,7 +7926,12 @@ exports.createSSRApp = createSSRApp;
exports.e = e;
exports.f = f;
exports.index = index;
exports.n = n;
exports.o = o;
exports.onMounted = onMounted;
exports.reactive = reactive;
exports.ref = ref;
exports.resolveComponent = resolveComponent;
exports.t = t;
exports.unref = unref;
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map