Hi is it possible to pre populate the fields for an AutoCreateForm? I’ve tried using v-model but it doesn’t display or submit
const createUser = ref<CreateUser>(new CreateUser({note: "SOME TEXT"}));
<AutoCreateForm
v-model="createUser"
form-style="card" type="CreateUser"
/>
Am I going about it the correct way? If not can you please point me to an example of an AutoCreateForm being pre populated?
Thanks
Just seen the configure-field property for AutoCreateForm, is this the intended way to supply default field values?
mythz
3
It’s only bound to an empty DTO, but you should be able to pragmatically update its dto with its exposed setModel
API:
Include ref to component:
<AutoCreateForm ref="refForm" form-style="card" type="CreateUser" />
You can use setModel
to update it:
const refForm = ref()
onMounted(() => {
refForm.value?.setModel({note: "SOME TEXT"})
})
1 Like