refactor: codegen

This commit is contained in:
xingyu
2022-07-28 21:40:15 +08:00
parent 607f6e4bb5
commit 291f31be98
9 changed files with 127 additions and 126 deletions

View File

@@ -5,7 +5,7 @@ import { CodegenTableVO } from '@/api/infra/codegen/types'
import { Form } from '@/components/Form'
import { useForm } from '@/hooks/web/useForm'
const props = defineProps({
currentRow: {
basicInfo: {
type: Object as PropType<Nullable<CodegenTableVO>>,
default: () => null
}
@@ -66,11 +66,11 @@ const { register, methods, elFormRef } = useForm({
schema
})
watch(
() => props.currentRow,
(currentRow) => {
if (!currentRow) return
() => props.basicInfo,
(basicInfo) => {
if (!basicInfo) return
const { setValues } = methods
setValues(currentRow)
setValues(basicInfo)
},
{
deep: true,