feat: Form useForm 完成

This commit is contained in:
kailong321200875
2023-06-21 11:28:03 +08:00
parent 097b32e1a9
commit 3e4e27c21f
9 changed files with 173 additions and 26 deletions

View File

@@ -14,7 +14,8 @@ import {
ElRadio,
ElRadioButton,
ElCheckbox,
ElCheckboxButton
ElCheckboxButton,
ElInput
} from 'element-plus'
import { getDictOneApi } from '@/api/common'
@@ -1384,6 +1385,18 @@ const schema = reactive<FormSchema[]>([
}
}
},
{
field: 'field69-1',
component: 'Input',
label: `custom formItem`,
formItemProps: {
slots: {
default: (formModel: any) => {
return <ElInput v-model={formModel['field69-1']} />
}
}
}
},
{
field: 'field70',
component: 'Divider',
@@ -1401,6 +1414,45 @@ const schema = reactive<FormSchema[]>([
const res = await getDictOneApi()
return res.data
}
},
{
field: 'field72',
label: `${t('formDemo.selectV2')}`,
component: 'SelectV2',
componentProps: {
options: []
},
// 远程加载option
optionApi: async () => {
const res = await getDictOneApi()
return res.data
}
},
{
field: 'field73',
label: `${t('formDemo.checkboxGroup')}`,
component: 'CheckboxGroup',
componentProps: {
options: []
},
// 远程加载option
optionApi: async () => {
const res = await getDictOneApi()
return res.data
}
},
{
field: 'field74',
label: `${t('formDemo.radioGroup')}`,
component: 'RadioGroup',
componentProps: {
options: []
},
// 远程加载option
optionApi: async () => {
const res = await getDictOneApi()
return res.data
}
}
])