vue paging remove the last piece of data, return to the previous page of

I paged packaging components, specific code can see my previous blog, directly on the code here

In the event inside delete, delete successfully joined this code

  // For When you delete the last page of the last data successfully jump back to the last page Previous 
        const TotalPage Math.ceil = (( this .count - 1 ) / this .pageSize) // total number of pages 
        this = .currentPage the this .currentPage> TotalPage TotalPage:? the this .currentPage
         the this .currentPage = the this .currentPage < 1 ? 1 : the this .currentPage

 

Guess you like

Origin www.cnblogs.com/wangliko/p/10930708.html