From f3835a1d8355dc2749de74b8d12244e7ca3711a0 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 3 Jan 2025 15:31:00 +0100 Subject: [PATCH] fix: refs #8197 vnPaginate when change :id --- src/components/ui/VnPaginate.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue index a2ccd5d92..ee6937add 100644 --- a/src/components/ui/VnPaginate.vue +++ b/src/components/ui/VnPaginate.vue @@ -2,6 +2,7 @@ import { onBeforeUnmount, onMounted, ref, watch } from 'vue'; import { useI18n } from 'vue-i18n'; import { useArrayData } from 'composables/useArrayData'; +import { onBeforeRouteUpdate } from 'vue-router'; const { t } = useI18n(); @@ -110,6 +111,13 @@ onMounted(async () => { mounted.value = true; }); +// onBeforeRouteUpdate((to, from, next) => { +// if (to.name === from.name && to.path !== from.path) { +// arrayData.reset(['data']); +// } +// next(); +// }); + onBeforeUnmount(() => { arrayData.resetPagination(); });