0
0
Fork 0

fix: refs #7623 update add updateRoute prop in VnPaginate

This commit is contained in:
Jorge Penadés 2024-06-24 12:51:44 +02:00
parent ec7b0c1416
commit 9169b793a9
2 changed files with 7 additions and 2 deletions

View File

@ -21,7 +21,7 @@ const currentUser = ref(state.getUser());
const newNote = ref(''); const newNote = ref('');
const vnPaginateRef = ref(); const vnPaginateRef = ref();
function handleKeyUp(event) { function handleKeyUp(event) {
if (event.key === 'Enter') { if (event.key === 'Enter') {
event.preventDefault(); event.preventDefault();
if (!event.shiftKey) insert(); if (!event.shiftKey) insert();
} }
@ -77,6 +77,7 @@ async function insert() {
auto-load auto-load
ref="vnPaginateRef" ref="vnPaginateRef"
class="show" class="show"
:update-router="false"
v-bind="$attrs" v-bind="$attrs"
> >
<template #body="{ rows }"> <template #body="{ rows }">

View File

@ -66,6 +66,10 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: false, default: false,
}, },
updateRouter: {
type: Boolean,
default: true,
},
}); });
const emit = defineEmits(['onFetch', 'onPaginate', 'onChange']); const emit = defineEmits(['onFetch', 'onPaginate', 'onChange']);
@ -120,7 +124,7 @@ async function fetch(params) {
useArrayData(props.dataKey, params); useArrayData(props.dataKey, params);
store.filter.skip = 0; store.filter.skip = 0;
store.skip = 0; store.skip = 0;
await arrayData.fetch({ append: false }); await arrayData.fetch({ append: false, updateRouter: props.updateRouter });
if (!store.hasMoreData) { if (!store.hasMoreData) {
isLoading.value = false; isLoading.value = false;
} }