+
- {{ title.charAt(0) }}
-
+
+ {{ title.charAt(0) }}
+
+
-
-
- {{ $props.description }}
-
+
+
+
diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue
index ebae673a2..e3019663c 100644
--- a/src/components/ui/VnFilterPanel.vue
+++ b/src/components/ui/VnFilterPanel.vue
@@ -82,23 +82,26 @@ onMounted(() => {
});
function setUserParams(watchedParams) {
- if (!watchedParams) return;
+ if (!watchedParams || Object.keys(watchedParams).length == 0) return;
if (typeof watchedParams == 'string') watchedParams = JSON.parse(watchedParams);
+ if (typeof watchedParams?.filter == 'string')
+ watchedParams.filter = JSON.parse(watchedParams.filter);
+
watchedParams = { ...watchedParams, ...watchedParams.filter?.where };
+ const order = watchedParams.filter?.order;
+
delete watchedParams.filter;
- userParams.value = { ...userParams.value, ...watchedParams };
- emit('setUserParams', userParams.value);
+ userParams.value = { ...userParams.value, ...sanitizer(watchedParams) };
+ emit('setUserParams', userParams.value, order);
}
watch(
- () => route.query[$props.searchUrl],
- (val) => setUserParams(val)
-);
-
-watch(
- () => arrayData.store.userParams,
- (val) => setUserParams(val)
+ () => [route.query[$props.searchUrl], arrayData.store.userParams],
+ ([newSearchUrl, newUserParams], [oldSearchUrl, oldUserParams]) => {
+ if (newSearchUrl || oldSearchUrl) setUserParams(newSearchUrl);
+ if (newUserParams || oldUserParams) setUserParams(newUserParams);
+ }
);
watch(
diff --git a/src/components/ui/VnImg.vue b/src/components/ui/VnImg.vue
index 985c9cc53..9585b81d8 100644
--- a/src/components/ui/VnImg.vue
+++ b/src/components/ui/VnImg.vue
@@ -1,6 +1,8 @@
-
+
-