fix: refs #8197 vnPaginate when change :id

This commit is contained in:
Alex Moreno 2025-01-03 15:31:00 +01:00
parent dc8fe65558
commit f3835a1d83
1 changed files with 8 additions and 0 deletions

View File

@ -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();
});