diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index a4cb55a2c..0de5d3aa2 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -77,7 +77,7 @@ const isLoading = ref(false); const hasChanges = ref(false); const originalData = ref(); const vnPaginateRef = ref(); -const formData = ref(); +const formData = ref([]); const saveButtonRef = ref(null); const watchChanges = ref(); const formUrl = computed(() => $props.url); diff --git a/src/components/VnTable/VnFilter.vue b/src/components/VnTable/VnFilter.vue index 9da0b26a4..86802ee92 100644 --- a/src/components/VnTable/VnFilter.vue +++ b/src/components/VnTable/VnFilter.vue @@ -25,7 +25,7 @@ const $props = defineProps({ }, searchUrl: { type: String, - default: 'params', + default: 'table', }, }); diff --git a/src/components/VnTable/VnOrder.vue b/src/components/VnTable/VnOrder.vue index 7fdd23b78..8ffdfe2bc 100644 --- a/src/components/VnTable/VnOrder.vue +++ b/src/components/VnTable/VnOrder.vue @@ -17,7 +17,7 @@ const $props = defineProps({ }, searchUrl: { type: String, - default: 'params', + default: 'table', }, vertical: { type: Boolean, diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index a8aca49dd..c3611c464 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -49,7 +49,7 @@ const $props = defineProps({ }, searchUrl: { type: String, - default: 'params', + default: 'table', }, redirect: { type: Boolean, diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue index 80c607214..b058dc642 100644 --- a/src/components/ui/VnPaginate.vue +++ b/src/components/ui/VnPaginate.vue @@ -44,7 +44,7 @@ const props = defineProps({ }, limit: { type: Number, - default: 10, + default: 20, }, userParams: { type: Object, @@ -100,7 +100,7 @@ const arrayData = useArrayData(props.dataKey, { const store = arrayData.store; onMounted(async () => { - if (props.autoLoad) await fetch(); + if (props.autoLoad && !store.data?.length) await fetch(); mounted.value = true; }); @@ -115,7 +115,11 @@ watch( watch( () => store.data, - (data) => emit('onChange', data) + (data) => { + if (!mounted.value) return; + emit('onChange', data); + }, + { immediate: true } ); watch( diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index dc6d4751c..da2d370fe 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -45,7 +45,7 @@ const props = defineProps({ }, limit: { type: Number, - default: 10, + default: 20, }, userParams: { type: Object, diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index 9348793d2..269231797 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -271,7 +271,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) { const pushUrl = { path: to }; if (to.endsWith('/list') || to.endsWith('/')) pushUrl.query = newUrl.query; - destroy(); + else destroy(); return router.push(pushUrl); } } diff --git a/src/pages/Account/AccountList.vue b/src/pages/Account/AccountList.vue index 9e7f1b10a..cbaaf8e26 100644 --- a/src/pages/Account/AccountList.vue +++ b/src/pages/Account/AccountList.vue @@ -104,7 +104,7 @@ const exprBuilder = (param, value) => {