From c7c6f0f1c6d0b7fb32a025811d776b7d57dc3619 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 16 Jul 2024 13:50:16 +0200 Subject: [PATCH] filter: vnfilterPanel --- src/components/ui/VnFilterPanel.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 9eff3d322..332e83d3c 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -10,7 +10,7 @@ const { t } = useI18n(); const $props = defineProps({ modelValue: { type: Object, - default: () => {} + default: () => {}, }, dataKey: { type: String, @@ -67,9 +67,9 @@ const arrayData = useArrayData($props.dataKey, { }); const route = useRoute(); const store = arrayData.store; -const userParams = ref({}) +const userParams = ref({}); onMounted(() => { - userParams.value = $props.modelValue ?? {} + userParams.value = $props.modelValue ?? {}; emit('init', { params: userParams.value }); }); @@ -92,6 +92,11 @@ watch( (val) => setUserParams(val) ); +watch( + () => $props.modelValue, + (val) => (userParams.value = val ?? {}) +); + const isLoading = ref(false); async function search(evt) { if (evt && $props.disableSubmitEvent) return;