diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index 33c831e3fb..0386e037b3 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -189,11 +189,11 @@ async function saveChanges(data) { }); } -async function insert() { +async function insert(pushData = $props.dataRequired) { const $index = formData.value.length ? formData.value[formData.value.length - 1].$index + 1 : 0; - formData.value.push(Object.assign({ $index }, $props.dataRequired)); + formData.value.push(Object.assign({ $index }, pushData)); hasChanges.value = true; } diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 2f173cd852..20482c4947 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -89,6 +89,10 @@ const $props = defineProps({ type: Object, default: () => ({}), }, + crudModel: { + type: Object, + default: () => ({}), + }, tableHeight: { type: String, default: '90vh', @@ -369,6 +373,7 @@ function handleOnDataSaved(_, res) {