mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-04 21:15:45 +02:00
refactor8frontend9: anyを除去 (#16778)
This commit is contained in:
@@ -19,10 +19,13 @@ export function useForm<T extends Record<string, any>>(initialState: T, save: (n
|
||||
const currentState = reactive<T>(copy(initialState));
|
||||
const previousState = reactive<T>(copy(initialState));
|
||||
|
||||
const modifiedStates = reactive<Record<keyof T, boolean>>({} as any);
|
||||
for (const key in currentState) {
|
||||
modifiedStates[key] = false;
|
||||
}
|
||||
const modifiedStates = reactive<Record<keyof T, boolean>>((() => {
|
||||
const obj: Record<keyof T, boolean> = {} as Record<keyof T, boolean>;
|
||||
for (const key in initialState) {
|
||||
obj[key] = false;
|
||||
}
|
||||
return obj;
|
||||
})());
|
||||
const modified = computed(() => Object.values(modifiedStates).some(v => v));
|
||||
const modifiedCount = computed(() => Object.values(modifiedStates).filter(v => v).length);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user