Skip to content

A continuation of HomeBox the inventory and organization system built for the Home User

fix(items page): watch search query from navbar search (#1236)

Đức3e473cf0f50b
diff --git a/frontend/pages/items.vue b/frontend/pages/items.vue
index 3e3231be..36198910 100644
--- a/frontend/pages/items.vue
+++ b/frontend/pages/items.vue
@@ -231,6 +231,15 @@
}
});
+ watch(
+ () => useRoute().query.q,
+ (newV, oldV) => {
+ if (newV !== oldV) {
+ query.value = (newV as string) || "";
+ }
+ }
+ );
+
async function fetchValues(field: string): Promise<string[]> {
if (fieldValuesCache.value[field]) {
return fieldValuesCache.value[field];