From fab1eb13b35f22645ff9b6d1886b2bc288bc1660 Mon Sep 17 00:00:00 2001 From: Ayaka Rizumu <464388324@qq.com> Date: Thu, 19 Jan 2023 18:50:56 +0800 Subject: [PATCH] chore: update slimeform (#1312) --- package.json | 2 +- pages/settings/profile/appearance.vue | 5 ++--- pnpm-lock.yaml | 8 ++++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 643c8436..500ce77b 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "pinia": "^2.0.28", "shiki": "^0.12.1", "shiki-es": "^0.1.2", - "slimeform": "^0.8.0", + "slimeform": "^0.9.0", "string-length": "^5.0.1", "tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log", "tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store", diff --git a/pages/settings/profile/appearance.vue b/pages/settings/profile/appearance.vue index 6e29d2ec..aa11f3b5 100644 --- a/pages/settings/profile/appearance.vue +++ b/pages/settings/profile/appearance.vue @@ -22,7 +22,7 @@ const onlineSrc = $computed(() => ({ header: account?.header || '', })) -const { form, reset, submitter, dirtyFields, isError } = useForm({ +const { form, reset, submitter, isDirty, dirtyFields, isError } = useForm({ form: () => { // For complex types of objects, a deep copy is required to ensure correct comparison of initial and modified values const fieldsAttributes = Array.from({ length: maxAccountFieldCount.value }, (_, i) => { @@ -52,8 +52,7 @@ const { form, reset, submitter, dirtyFields, isError } = useForm({ }, }) -const isDirty = $computed(() => !isEmptyObject(dirtyFields.value)) -const isCanSubmit = computed(() => !isError.value && isDirty) +const isCanSubmit = computed(() => !isError.value && isDirty.value) const { submit, submitting } = submitter(async ({ dirtyFields }) => { if (!isCanSubmit.value) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4d5e9492..ee340d76 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -105,7 +105,7 @@ importers: shiki-es: ^0.1.2 simple-git: ^3.15.1 simple-git-hooks: ^2.8.1 - slimeform: ^0.8.0 + slimeform: ^0.9.0 stale-dep: ^0.3.1 std-env: ^3.3.1 string-length: ^5.0.1 @@ -160,7 +160,7 @@ importers: pinia: 2.0.28_typescript@4.9.4 shiki: 0.12.1 shiki-es: 0.1.2 - slimeform: 0.8.0 + slimeform: 0.9.0 string-length: 5.0.1 tauri-plugin-log-api: github.com/tauri-apps/tauri-plugin-log/9d2a19ad05fafeb80991006e14f0f95fe1109aba tauri-plugin-store-api: github.com/tauri-apps/tauri-plugin-store/c71665bf5dcf48ae70a88d622eb38b2548b60a5d @@ -10815,8 +10815,8 @@ packages: is-fullwidth-code-point: 4.0.0 dev: true - /slimeform/0.8.0: - resolution: {integrity: sha512-oh0GY3qPkN1ouH3TQex/+SbVsgGmJhZvgz8NqfECuMuSy7k0NOQNUudH/bebcAY7fIk5nVunMS2GPfo4UWwmDw==} + /slimeform/0.9.0: + resolution: {integrity: sha512-HTerdfrMNAx3JQQIuyJnjH5Ci/ntWUmahzcfUd7GUWtDD7C8Q/wZ7vg+v96C3o2bQ+G1/VXvy3m672KTtTRJNA==} peerDependencies: vue: '>=3' dev: false