feat: form 表单赋值
This commit is contained in:
@@ -11,7 +11,7 @@ import { $t } from '@vben/locales';
|
|||||||
async function initSetupVbenForm() {
|
async function initSetupVbenForm() {
|
||||||
setupVbenForm<ComponentType>({
|
setupVbenForm<ComponentType>({
|
||||||
config: {
|
config: {
|
||||||
// ant design vue组件库默认都是 v-model:value
|
// antdv-next 组件库默认都是 v-model:value
|
||||||
baseModelPropName: 'value',
|
baseModelPropName: 'value',
|
||||||
// 一些组件是 v-model:checked 或者 v-model:fileList
|
// 一些组件是 v-model:checked 或者 v-model:fileList
|
||||||
modelPropNameMap: {
|
modelPropNameMap: {
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ const [Form, formApi] = useVbenForm({
|
|||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
|
class: 'w-full',
|
||||||
options: [
|
options: [
|
||||||
{ label: '选项1', value: '1' },
|
{ label: '选项1', value: '1' },
|
||||||
{ label: '选项2', value: '2' },
|
{ label: '选项2', value: '2' },
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ function openFormModal() {
|
|||||||
formModalApi
|
formModalApi
|
||||||
.setData({
|
.setData({
|
||||||
// 表单值
|
// 表单值
|
||||||
values: { field1: 'abc', field2: '123' },
|
values: { field1: 'abc', field2: '123', field3: '1' },
|
||||||
})
|
})
|
||||||
.open();
|
.open();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user