欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

vue實(shí)現(xiàn)表格分頁(yè)功能

 更新時(shí)間:2021年10月20日 11:57:10   作者:鯨�落南北  
這篇文章主要為大家詳細(xì)介紹了vue實(shí)現(xiàn)表格分頁(yè)功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了vue實(shí)現(xiàn)表格分頁(yè)功能的具體代碼,供大家參考,具體內(nèi)容如下

直接上代碼:

這里是這里是template部分,主要由一個(gè)需要分頁(yè)的表格和一個(gè)分頁(yè)器組成。重點(diǎn)在于表格的data屬性用到了一個(gè)slice截取方法。

<el-table
        v-loading="listLoading"
        :data="
          list.slice((currentPage - 1) * pageSize, currentPage * pageSize)
        "
        element-loading-text="Loading"
        highlight-current-row
        border
      >
        <el-table-column align="center" label="序號(hào)" width="90">
          <template slot-scope="scope">
            {{ scope.$index + 1 }}
          </template>
        </el-table-column>
        <el-table-column label="頭像" align="center" width="150">
          <template slot-scope="scope">
            <el-avatar :src="scope.row.avatar"></el-avatar>
          </template>
        </el-table-column>
        <el-table-column align="center" label="UID" width="130">
          <template slot-scope="scope">
            {{ scope.row.UID }}
          </template>
        </el-table-column>
        <el-table-column align="center" label="用戶名" width="350">
          <template slot-scope="scope">
            {{ scope.row.username }}
          </template>
        </el-table-column>
        <el-table-column align="center" label="游戲ID" width="350">
          <template slot-scope="scope"> {{ scope.row.usernick }} </template>
        </el-table-column>
        <el-table-column label="授權(quán)類型" width="110" align="center">
          <template slot-scope="scope">
            <el-tag :type="scope.row.authorizationType | tagTypeFilter">{{
              scope.row.authorizationType | authorizationTypeFilter
            }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column align="center" label="成功邀請(qǐng)人數(shù)" width="150">
          <template slot-scope="scope">{{ scope.row.successNum }} </template>
        </el-table-column>
        <!-- <el-table-column align="center" label="操作" width="150">
          <template slot-scope="scope">
            <el-button
              type="primary"
              size="mini"
              @click="change(scope.$index, scope.row)"
            >
              修改
            </el-button>
          </template>
        </el-table-column> -->
      </el-table>
      <!-- 分頁(yè)器 -->
      <div class="block" style="margin-top: 15px">
        <el-pagination
          align="right"
          @current-change="handleCurrentChange"
          :current-page="currentPage"
          :page-size="pageSize"
          layout="prev, pager, next,total"
          background
          :total="filterList.length"
          hide-on-single-page
        >
        </el-pagination>
</div>

這里是javascript部分:

export default{
    data(){
        return{
            currentPage:1//當(dāng)前頁(yè)碼
            pageSize:10//每頁(yè)顯示條數(shù)
            list:[]//要顯示的表格數(shù)據(jù)
             }
        }
 
    methods{
            handleCurrentChange(val) {
            this.currentPage = val;
        },
    }
 
}

實(shí)現(xiàn)如圖效果

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • vue實(shí)現(xiàn)的封裝全局filter并統(tǒng)一管理操作示例

    vue實(shí)現(xiàn)的封裝全局filter并統(tǒng)一管理操作示例

    這篇文章主要介紹了vue實(shí)現(xiàn)的封裝全局filter并統(tǒng)一管理操作,結(jié)合實(shí)例形式詳細(xì)分析了vue封裝全局filter及相關(guān)使用技巧,需要的朋友可以參考下
    2020-02-02
  • Vue2.0仿餓了么webapp單頁(yè)面應(yīng)用詳細(xì)步驟

    Vue2.0仿餓了么webapp單頁(yè)面應(yīng)用詳細(xì)步驟

    本篇文章給大家分享了Vue2.0仿餓了么webapp單頁(yè)面應(yīng)用詳細(xì)步驟,有興趣的朋友可以跟著操作下。
    2018-07-07
  • vue 項(xiàng)目中的this.$get,this.$post等$的用法案例詳解

    vue 項(xiàng)目中的this.$get,this.$post等$的用法案例詳解

    vue.js的插件應(yīng)該暴露一個(gè)install方法。這個(gè)方法的第一個(gè)參數(shù)是vue構(gòu)造器,第二個(gè)參數(shù)是一個(gè)可選的選項(xiàng)對(duì)象,首頁(yè)要安裝axios,本文結(jié)合案例代碼給大家詳細(xì)講解vue 中的this.$get,this.$post等$的用法,一起學(xué)習(xí)下吧
    2022-12-12
  • 淺談vue單頁(yè)面中有多個(gè)echarts圖表時(shí)的公用代碼寫(xiě)法

    淺談vue單頁(yè)面中有多個(gè)echarts圖表時(shí)的公用代碼寫(xiě)法

    這篇文章主要介紹了淺談vue單頁(yè)面中有多個(gè)echarts圖表時(shí)的公用代碼寫(xiě)法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2020-07-07
  • vue 實(shí)現(xiàn)把路由單獨(dú)分離出來(lái)

    vue 實(shí)現(xiàn)把路由單獨(dú)分離出來(lái)

    這篇文章主要介紹了vue 實(shí)現(xiàn)把路由單獨(dú)分離出來(lái),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2020-08-08
  • vue計(jì)算屬性computed--getter和setter用法

    vue計(jì)算屬性computed--getter和setter用法

    這篇文章主要介紹了vue計(jì)算屬性computed--getter和setter用法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-01-01
  • Vue之mixin混入詳解

    Vue之mixin混入詳解

    這篇文章主要為大家介紹了Vue之mixin混入,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下,希望能夠給你帶來(lái)幫助
    2021-11-11
  • Vue面試題及Vue知識(shí)點(diǎn)整理

    Vue面試題及Vue知識(shí)點(diǎn)整理

    這篇文章主要介紹了Vue面試題及Vue知識(shí)點(diǎn)整理,本文給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友參考下吧
    2018-10-10
  • Vue中使用防抖與節(jié)流的方法

    Vue中使用防抖與節(jié)流的方法

    這篇文章主要為大家介紹了Vue中使用防抖與節(jié)流的方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下,希望能夠給你帶來(lái)幫助
    2022-01-01
  • vue3聲明字段名為枚舉的類型詳解

    vue3聲明字段名為枚舉的類型詳解

    這篇文章主要介紹了vue3聲明字段名為枚舉的類型方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-09-09

最新評(píng)論