diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index ab484015b..2f184fbe7 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -28,6 +28,7 @@ onMounted(() => { }); async function search() { + console.log('search!'); await arrayData.apply({ params: { search: searchText.value, diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index 391c9ee2b..e9e65ae23 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -20,6 +20,7 @@ export function useArrayData(key, userOptions) { const page = ref(1); if (typeof userOptions === 'object') { + if (userOptions.filter) store.filter = userOptions.filter; if (userOptions.url) store.url = userOptions.url; if (userOptions.limit) store.limit = userOptions.limit; if (userOptions.order) store.order = userOptions.order; @@ -38,9 +39,10 @@ export function useArrayData(key, userOptions) { }); onUnmounted(() => { - if (arrayDataStore.get(key)) { - arrayDataStore.clear(key); - } + // if (arrayDataStore.get(key)) { + // arrayDataStore.clear(key); + // } + // do stuff }); async function fetch({ append = false }) { @@ -53,6 +55,7 @@ export function useArrayData(key, userOptions) { }; Object.assign(filter, store.userFilter); + Object.assign(filter, store.filter); store.filter = filter; diff --git a/src/pages/Customer/Card/CustomerCard.vue b/src/pages/Customer/Card/CustomerCard.vue index 37b57bb70..8d6288fe5 100644 --- a/src/pages/Customer/Card/CustomerCard.vue +++ b/src/pages/Customer/Card/CustomerCard.vue @@ -2,10 +2,15 @@ import { useState } from 'src/composables/useState'; import CustomerDescriptor from './CustomerDescriptor.vue'; import LeftMenu from 'components/LeftMenu.vue'; +import TeleportSlot from 'components/ui/TeleportSlot.vue'; +import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; const state = useState();