update
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {ref, reactive, watch} from 'vue';
|
||||
import {reactive, ref, watch} from 'vue';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -41,6 +41,7 @@ function useTableQuery({
|
||||
callback && callback({
|
||||
...data,
|
||||
rows: data.rows.map(v => ({...v, key: v.id})),
|
||||
current: pagination.current
|
||||
});
|
||||
} finally {
|
||||
loading.value = false;
|
||||
@@ -48,8 +49,12 @@ function useTableQuery({
|
||||
}
|
||||
|
||||
const initFetchData = async () => {
|
||||
pagination.current = 1;
|
||||
pagination.total = 0;
|
||||
if (pagination.current === 1) {
|
||||
fetchData().then();
|
||||
} else {
|
||||
pagination.current = 1;
|
||||
pagination.total = 0;
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
@@ -60,7 +65,7 @@ function useTableQuery({
|
||||
|
||||
if (watchParameter) watch(
|
||||
() => parameter,
|
||||
() => fetchData(),
|
||||
() => initFetchData(),
|
||||
{deep: true}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user