diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 115145f37..a0f6bf479 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -100,7 +100,6 @@ const isResetting = ref(false); const hasChanges = ref(!$props.observeFormChanges); const originalData = ref({}); const formData = computed(() => state.get(modelValue)); -const formUrl = computed(() => $props.url); const defaultButtons = computed(() => ({ save: { color: 'primary', @@ -148,11 +147,14 @@ if (!$props.url) (val) => updateAndEmit('onFetch', val) ); -watch(formUrl, async () => { - originalData.value = null; - reset(); - await fetch(); -}); +watch( + () => [$props.url, $props.filter], + async () => { + originalData.value = null; + reset(); + await fetch(); + } +); onBeforeRouteLeave((to, from, next) => { if (hasChanges.value && $props.observeFormChanges) diff --git a/src/components/common/VnInputTime.vue b/src/components/common/VnInputTime.vue index a59f0e9e8..7ee93de19 100644 --- a/src/components/common/VnInputTime.vue +++ b/src/components/common/VnInputTime.vue @@ -50,7 +50,7 @@ const formattedTime = computed({ } if (!props.timeOnly) { const [hh, mm] = time.split(':'); - const date = model.value ?? Date.vnNew(); + const date = new Date(model.value ? model.value : null); date.setHours(hh, mm, 0); time = date?.toISOString(); } @@ -62,7 +62,7 @@ const formattedTime = computed({ function dateToTime(newDate) { return date.formatDate(new Date(newDate), dateFormat); } -const timeField = ref(); + watch( () => model.value, (val) => (formattedTime.value = val), @@ -153,4 +153,3 @@ watch( es: Open time: Abrir tiempo -, nextTick diff --git a/src/components/ui/VnSms.vue b/src/components/ui/VnSms.vue index ceb24b2bb..81058a6cb 100644 --- a/src/components/ui/VnSms.vue +++ b/src/components/ui/VnSms.vue @@ -1,5 +1,5 @@