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 43d634ad9..1ed1194ea 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..f5519eb01 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,10 @@ watch( watch( () => store.data, - (data) => emit('onChange', data) + (data) => { + 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 30bcac66b..7fa494349 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -269,7 +269,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 72c445fa9..9e750e1cb 100644 --- a/src/pages/Account/AccountList.vue +++ b/src/pages/Account/AccountList.vue @@ -104,7 +104,7 @@ const exprBuilder = (param, value) => {