From 5233c1455ae5a0009de80d96212384fef1dd1cda Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 31 Jul 2024 14:57:25 +0200 Subject: [PATCH 1/2] refactor: refs #7679 better way to update model --- src/components/CreateNewCityForm.vue | 6 +-- src/components/CreateNewPostcodeForm.vue | 53 +++++++++++------------- src/components/CreateNewProvinceForm.vue | 16 ++++++- src/components/VnSelectProvince.vue | 6 ++- src/components/common/VnLocation.vue | 2 +- src/components/common/VnSelect.vue | 16 +++---- 6 files changed, 52 insertions(+), 47 deletions(-) diff --git a/src/components/CreateNewCityForm.vue b/src/components/CreateNewCityForm.vue index 3861e3253..50dc41b5f 100644 --- a/src/components/CreateNewCityForm.vue +++ b/src/components/CreateNewCityForm.vue @@ -19,8 +19,8 @@ const cityFormData = reactive({ const provincesOptions = ref([]); -const onDataSaved = (dataSaved) => { - emit('onDataSaved', dataSaved); +const onDataSaved = (...args) => { + emit('onDataSaved', ...args); }; @@ -36,7 +36,7 @@ const onDataSaved = (dataSaved) => { :form-initial-data="cityFormData" url-create="towns" model="city" - @on-data-saved="onDataSaved($event)" + @on-data-saved="onDataSaved" >