forked from verdnatura/salix-front
handle searchbar dataKey change
This commit is contained in:
parent
b26bf10e70
commit
990e3f6e75
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { useQuasar } from 'quasar';
|
||||
import { useArrayData } from 'composables/useArrayData';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
|
@ -67,11 +67,19 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const arrayData = useArrayData(props.dataKey, { ...props });
|
||||
const { store } = arrayData;
|
||||
let arrayData = useArrayData(props.dataKey, { ...props });
|
||||
let store = arrayData.store;
|
||||
const searchText = ref('');
|
||||
const { navigate } = useRedirect();
|
||||
|
||||
watch(
|
||||
() => props.dataKey,
|
||||
(val) => {
|
||||
arrayData = useArrayData(val, { ...props });
|
||||
store = arrayData.store;
|
||||
}
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
const params = store.userParams;
|
||||
if (params && params.search) {
|
||||
|
|
Loading…
Reference in New Issue