修复表单响应性问题 & 更新套餐管理接口字段
This commit is contained in:
@@ -4,7 +4,7 @@ import {Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, DialogTr
|
||||
import {Button} from '@/components/ui/button'
|
||||
import {Form, FormField} from '@/components/ui/form'
|
||||
import {Input} from '@/components/ui/input'
|
||||
import {useForm, useFormContext} from 'react-hook-form'
|
||||
import {useForm, useFormContext, useWatch} from 'react-hook-form'
|
||||
import {zodResolver} from '@hookform/resolvers/zod'
|
||||
import * as z from 'zod'
|
||||
import {toast} from 'sonner'
|
||||
@@ -154,7 +154,7 @@ export function ChangePasswordDialog({
|
||||
}
|
||||
|
||||
function SendMsgByPhone() {
|
||||
const form = useFormContext<Schema>()
|
||||
const phone = form.watch('phone')
|
||||
const {control} = useFormContext<Schema>()
|
||||
const phone = useWatch({control, name: 'phone'})
|
||||
return <SendMsg phone={phone}/>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user