migrate transaction tag sheet to composition API and typescript

This commit is contained in:
MaysWind
2025-01-11 20:12:15 +08:00
parent ffae9e81a7
commit 6cb045453a
3 changed files with 119 additions and 124 deletions
+5 -5
View File
@@ -394,7 +394,7 @@ export function copyObjectTo(fromObject: Record<string, unknown> | undefined, to
return (toObject as Record<string, unknown>);
}
export function copyArrayTo(fromArray: unknown[], toArray: unknown[]): unknown[] {
export function copyArrayTo<T>(fromArray: T[], toArray: T[]): T[] {
if (!isArray(fromArray)) {
return toArray;
}
@@ -410,9 +410,9 @@ export function copyArrayTo(fromArray: unknown[], toArray: unknown[]): unknown[]
const toValue = toArray[i];
if (isArray(fromValue)) {
toArray[i] = copyArrayTo(fromValue as unknown[], toValue as unknown[]);
toArray[i] = copyArrayTo(fromValue as unknown[], toValue as unknown[]) as T;
} else if (isObject(fromValue)) {
toArray[i] = copyObjectTo(fromValue as Record<string, unknown>, toValue as Record<string, unknown>);
toArray[i] = copyObjectTo(fromValue as Record<string, unknown>, toValue as Record<string, unknown>) as T;
} else {
if (fromValue !== toValue) {
toArray[i] = fromValue;
@@ -420,9 +420,9 @@ export function copyArrayTo(fromArray: unknown[], toArray: unknown[]): unknown[]
}
} else {
if (isArray(fromValue)) {
toArray.push(copyArrayTo(fromValue as unknown[], []));
toArray.push(copyArrayTo(fromValue as unknown[], []) as T);
} else if (isObject(fromValue)) {
toArray.push(copyObjectTo(fromValue as Record<string, unknown>, {}));
toArray.push(copyObjectTo(fromValue as Record<string, unknown>, {}) as T);
} else {
toArray.push(fromValue);
}
+1 -1
View File
@@ -66,7 +66,7 @@ export function showToast(message: string, timeout: number | undefined, translat
});
}
export function showLoading(delayConditionFunc: () => boolean, delayMills: number): void {
export function showLoading(delayConditionFunc?: () => boolean, delayMills?: number): void {
if (!delayConditionFunc) {
f7ready((f7) => {
return f7.preloader.show();