fix(CrudModel): onChange $index
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
904acfd48f
commit
3087dbf512
|
@ -98,19 +98,17 @@ defineExpose({
|
|||
});
|
||||
|
||||
async function fetch(data) {
|
||||
if (data && Array.isArray(data)) {
|
||||
let $index = 0;
|
||||
data.map((d) => (d.$index = $index++));
|
||||
}
|
||||
|
||||
resetData(data);
|
||||
|
||||
emit('onFetch', data);
|
||||
return data;
|
||||
}
|
||||
|
||||
function resetData(data) {
|
||||
if (!data) return;
|
||||
if (data && Array.isArray(data)) {
|
||||
let $index = 0;
|
||||
data.map((d) => (d.$index = $index++));
|
||||
}
|
||||
originalData.value = JSON.parse(JSON.stringify(data));
|
||||
formData.value = JSON.parse(JSON.stringify(data));
|
||||
|
||||
|
@ -299,7 +297,7 @@ watch(formUrl, async () => {
|
|||
:url="url"
|
||||
:limit="limit"
|
||||
@on-fetch="fetch"
|
||||
@on-change="resetData"
|
||||
@on-change="fetch"
|
||||
:skeleton="false"
|
||||
ref="vnPaginateRef"
|
||||
v-bind="$attrs"
|
||||
|
|
Loading…
Reference in New Issue