indexMethod(index) {
// this.queryParams.Page當前頁碼,this.queryParams.Limit一頁展示多少數(shù)量,this.total總條數(shù),index索引值
if (this.total < this.queryParams.Limit) {
return this.total - index;
} else {
return (
this.total -
(this.queryParams.Page - 1) * this.queryParams.Limit -
index
);
}
},
//在element-ui的表格組件中使用
<el-table-column label="序號" type="index" :index="indexMethod" />
實現(xiàn)效果:不分頁
分頁: 第一頁
分頁: 第二頁
?
?
element-ui文檔說明
element-ui的官方文檔是默認升序:
?如果設置了tyle=index可以傳遞index屬性自定義索引文章來源:http://www.zghlxwxcb.cn/news/detail-512197.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-512197.html
到了這里,關于在Vue+element UI項目中 自定義表格索引實現(xiàn)序號倒序排列的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!