chore: update slimeform (#1312)

This commit is contained in:
Ayaka Rizumu 2023-01-19 18:50:56 +08:00 committed by GitHub
parent c3b9f8fc2a
commit fab1eb13b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 8 deletions

View file

@ -57,7 +57,7 @@
"pinia": "^2.0.28", "pinia": "^2.0.28",
"shiki": "^0.12.1", "shiki": "^0.12.1",
"shiki-es": "^0.1.2", "shiki-es": "^0.1.2",
"slimeform": "^0.8.0", "slimeform": "^0.9.0",
"string-length": "^5.0.1", "string-length": "^5.0.1",
"tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log", "tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log",
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store", "tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store",

View file

@ -22,7 +22,7 @@ const onlineSrc = $computed(() => ({
header: account?.header || '', header: account?.header || '',
})) }))
const { form, reset, submitter, dirtyFields, isError } = useForm({ const { form, reset, submitter, isDirty, dirtyFields, isError } = useForm({
form: () => { form: () => {
// For complex types of objects, a deep copy is required to ensure correct comparison of initial and modified values // 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) => { 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.value)
const isCanSubmit = computed(() => !isError.value && isDirty)
const { submit, submitting } = submitter(async ({ dirtyFields }) => { const { submit, submitting } = submitter(async ({ dirtyFields }) => {
if (!isCanSubmit.value) if (!isCanSubmit.value)

View file

@ -105,7 +105,7 @@ importers:
shiki-es: ^0.1.2 shiki-es: ^0.1.2
simple-git: ^3.15.1 simple-git: ^3.15.1
simple-git-hooks: ^2.8.1 simple-git-hooks: ^2.8.1
slimeform: ^0.8.0 slimeform: ^0.9.0
stale-dep: ^0.3.1 stale-dep: ^0.3.1
std-env: ^3.3.1 std-env: ^3.3.1
string-length: ^5.0.1 string-length: ^5.0.1
@ -160,7 +160,7 @@ importers:
pinia: 2.0.28_typescript@4.9.4 pinia: 2.0.28_typescript@4.9.4
shiki: 0.12.1 shiki: 0.12.1
shiki-es: 0.1.2 shiki-es: 0.1.2
slimeform: 0.8.0 slimeform: 0.9.0
string-length: 5.0.1 string-length: 5.0.1
tauri-plugin-log-api: github.com/tauri-apps/tauri-plugin-log/9d2a19ad05fafeb80991006e14f0f95fe1109aba tauri-plugin-log-api: github.com/tauri-apps/tauri-plugin-log/9d2a19ad05fafeb80991006e14f0f95fe1109aba
tauri-plugin-store-api: github.com/tauri-apps/tauri-plugin-store/c71665bf5dcf48ae70a88d622eb38b2548b60a5d tauri-plugin-store-api: github.com/tauri-apps/tauri-plugin-store/c71665bf5dcf48ae70a88d622eb38b2548b60a5d
@ -10815,8 +10815,8 @@ packages:
is-fullwidth-code-point: 4.0.0 is-fullwidth-code-point: 4.0.0
dev: true dev: true
/slimeform/0.8.0: /slimeform/0.9.0:
resolution: {integrity: sha512-oh0GY3qPkN1ouH3TQex/+SbVsgGmJhZvgz8NqfECuMuSy7k0NOQNUudH/bebcAY7fIk5nVunMS2GPfo4UWwmDw==} resolution: {integrity: sha512-HTerdfrMNAx3JQQIuyJnjH5Ci/ntWUmahzcfUd7GUWtDD7C8Q/wZ7vg+v96C3o2bQ+G1/VXvy3m672KTtTRJNA==}
peerDependencies: peerDependencies:
vue: '>=3' vue: '>=3'
dev: false dev: false