refactor: 彻底删除 useForm 组合函数

This commit is contained in:
2024-11-23 22:57:44 +08:00
parent 7fa42975cf
commit 7fe3ffe9da
6 changed files with 8 additions and 26 deletions

View File

@@ -130,14 +130,14 @@ import {
updateOption,
} from '@/apis/system'
import { useAppStore } from '@/stores'
import { useForm } from '@/hooks'
import { useResetReactive } from '@/hooks'
import { fileToBase64 } from '@/utils'
defineOptions({ name: 'BasicSetting' })
const loading = ref<boolean>(false)
const formRef = ref<FormInstance>()
const { form } = useForm({
const [form] = useResetReactive({
SITE_FAVICON: '',
SITE_LOGO: '',
SITE_TITLE: '',

View File

@@ -69,13 +69,13 @@ import {
resetOptionValue,
updateOption,
} from '@/apis/system'
import { useForm } from '@/hooks'
import { useResetReactive } from '@/hooks'
defineOptions({ name: 'MailSetting' })
const { width } = useWindowSize()
const loading = ref<boolean>(false)
const formRef = ref<FormInstance>()
const { form } = useForm({
const [form] = useResetReactive({
MAIL_PROTOCOL: '',
MAIL_HOST: '',
MAIL_PORT: 0,

View File

@@ -112,14 +112,14 @@
import { useWindowSize } from '@vueuse/core'
import { type FormInstance, Message, Modal } from '@arco-design/web-vue'
import { type OptionResp, type SecurityConfig, listOption, resetOptionValue, updateOption } from '@/apis/system'
import { useForm } from '@/hooks'
import { useResetReactive } from '@/hooks'
defineOptions({ name: 'SecuritySetting' })
const { width } = useWindowSize()
const loading = ref<boolean>(false)
const formRef = ref<FormInstance>()
const { form } = useForm({
const [form] = useResetReactive({
PASSWORD_ERROR_LOCK_COUNT: 0,
PASSWORD_ERROR_LOCK_MINUTES: 0,
PASSWORD_EXPIRATION_DAYS: 0,