ant design vue table表删除列表最后一条数据如何自动跳转到上一页(vue3)?

我是根据百度直接在删除中判断

  //请求删除

async function requestDelete(){

SmartLoading.show();

try {

console.log(currentRow.value)

if(currentRow.value == undefined){

message.error('请选择右边行')

return

}else{

await casePicApi.delete(currentRow.value.id);

message.success('删除成功');

currentRow.value = undefined

** let lastPage = Math.ceil(

total.value / queryFormState.value.pageSize //总数除以每页记录数

);

if (queryFormState.value.pageNum === lastPage && total.value % queryFormState.value.pageSize === 1)

{

queryFormState.pageNum--; //页码-1

** }****

queryData()

}

} catch (e) {

smartSentry.captureError(e);

} finally {

SmartLoading.hide();

}

}

ant design vue table表删除列表最后一条数据如何自动跳转到上一页(vue3)?


回答:

queryFormState.value.pageNum--; //

if (

queryFormState.value.pageNum === lastPage &&

total.value % queryFormState.value.pageSize === 1

) {

queryFormState.value.pageNum--; // 页码-1

}

以上是 ant design vue table表删除列表最后一条数据如何自动跳转到上一页(vue3)? 的全部内容, 来源链接: utcz.com/p/934180.html

回到顶部