亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

vue+elementUI實現(xiàn)分頁效果

 更新時間:2022年07月07日 07:17:55   作者:小白_0615  
這篇文章主要為大家詳細介紹了vue+elementUI實現(xiàn)分頁效果,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實例為大家分享了vue+elementUI實現(xiàn)分頁效果的具體代碼,供大家參考,具體內(nèi)容如下

頁面中渲染的數(shù)據(jù)不是所有數(shù)據(jù),是需要展示的數(shù)據(jù),即當前頁的數(shù)據(jù),默認第一頁的數(shù)據(jù),這里為showDate

template中代碼段(渲染數(shù)據(jù))

<div style="height:76vh;margin-top:1%">
? ? ? ? ? ? <el-table :data="showData"
? ? ? ? ? ? ? ? ? ? ? style="width: 100%"
? ? ? ? ? ? ? ? ? ? ? :header-cell-style="headClass">
? ? ? ? ? ? ? ? <el-table-column type="index"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?label="編號"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?width="80"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?header-align="center"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?align="center"></el-table-column>
? ? ? ? ? ? ? ? <el-table-column prop="name"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?label="企業(yè)名稱"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?width="180"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?header-align="center"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?align="center"></el-table-column>
? ? ? ? ? ? ? ? <el-table-column prop="date"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?label="注冊時間"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?width="150"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?header-align="center"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?align="center"></el-table-column>
? ? ? ? ? ? ? ? <el-table-column prop="publishNumber"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?label="發(fā)布崗位數(shù)量"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?width="130"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?header-align="center"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?align="center"></el-table-column>
? ? ? ? ? ? ? ? <el-table-column prop="checkTimes"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?label="查看簡歷次數(shù)"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?width="130"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?header-align="center"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?align="center"></el-table-column>
? ? ? ? ? ? ? ? <el-table-column prop="companyStatus"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?label="崗位發(fā)布權(quán)限"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?width="130"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?header-align="center"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?align="center">
? ? ? ? ? ? ? ? ? ? <template slot-scope="scope">
? ? ? ? ? ? ? ? ? ? ? ? <span v-if="scope.row.companyStatus == 1">否</span>
? ? ? ? ? ? ? ? ? ? ? ? <span v-else-if="scope.row.companyStatus == 0">是</span>
? ? ? ? ? ? ? ? ? ? </template>
? ? ? ? ? ? ? ? </el-table-column>
? ? ? ? ? ? ? ? <el-table-column prop="companyStatus"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?label="查看人才權(quán)限"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?width="130"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?header-align="center"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?align="center">
? ? ? ? ? ? ? ? ? ? <template slot-scope="scope">
? ? ? ? ? ? ? ? ? ? ? ? <span v-if="scope.row.companyStatus == 1">否</span>
? ? ? ? ? ? ? ? ? ? ? ? <span v-else-if="scope.row.companyStatus == 0">是</span>
? ? ? ? ? ? ? ? ? ? </template>
? ? ? ? ? ? ? ? </el-table-column>
?
? ? ? ? ? ? ? ? <el-table-column prop="RecruitmentTimes"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?label="現(xiàn)場招聘次數(shù)"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?width="130"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?header-align="center"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?align="center"></el-table-column>
?
? ? ? ? ? ? ? ? <el-table-column prop="windowPublishTimes"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?label="櫥窗發(fā)布次數(shù)"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?width="130"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?header-align="center"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?align="center"></el-table-column>
?
? ? ? ? ? ? ? ? <el-table-column prop="companyStatus"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?label="企業(yè)狀態(tài)"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?width="130"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?header-align="center"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?align="center">
? ? ? ? ? ? ? ? ? ? <template slot-scope="scope">
? ? ? ? ? ? ? ? ? ? ? ? <span v-if="scope.row.companyStatus == 1"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? style="color: #1ec6df">啟用</span>
? ? ? ? ? ? ? ? ? ? ? ? <span v-else-if="scope.row.companyStatus == 0"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? style="color: #df721e">禁用</span>
? ? ? ? ? ? ? ? ? ? </template>
? ? ? ? ? ? ? ? </el-table-column>
?
? ? ? ? ? ? ? ? <el-table-column fixed="right"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?label="操作"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?width="280">
?
? ? ? ? ? ? ? ? ? ? <template>
? ? ? ? ? ? ? ? ? ? ? ? <el-link :underline="false"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?href="#" rel="external nofollow"  rel="external nofollow" 
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?class="alink">崗位列表</el-link>
? ? ? ? ? ? ? ? ? ? ? ? <el-link :underline="false"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?href="#" rel="external nofollow"  rel="external nofollow" 
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?class="alink">開通記錄</el-link>
? ? ? ? ? ? ? ? ? ? </template>
? ? ? ? ? ? ? ? </el-table-column>
? ? ? </el-table>
</div>

template中代碼段(分頁部分,與上一段代碼同層級)

<div class="block">
? ? ? ? ? ? <el-pagination :page-size="pagesize"
? ? ? ? ? ? ? ? ? ? ? ? ? ?:current-page="currentPage"
? ? ? ? ? ? ? ? ? ? ? ? ? ?layout="prev, pager, next"
? ? ? ? ? ? ? ? ? ? ? ? ? ?:total="companyData.length"
? ? ? ? ? ? ? ? ? ? ? ? ? ?@current-change="handleCurrentChange"
? ? ? ? ? ? ? ? ? ? ? ? ? ?@prev-click="upChange"
? ? ? ? ? ? ? ? ? ? ? ? ? ?@next-click="nextChange"
? ? ? ? ? ? ? ? ? ? ? ? ? ?style="text-align: center;">
? ? ? ? </el-pagination>
</div>

下面是邏輯實現(xiàn)

1.定義數(shù)組

2.初始化賦值第一頁的數(shù)據(jù)

slice() 

<script>
export default {
? ? //頁面第一次加載 顯示的數(shù)據(jù)
? ? created() {
? ? ? ? this.showData = this.companyData.slice(0, this.pagesize);
? ? ? ? console.log("顯示的數(shù)據(jù)");
? ? ? ? console.log(this.showData);
? ? },
? ? data() {
? ? ? ? return {
? ? ? ? ? ? // 企業(yè)名稱
? ? ? ? ? ? companyName: "",
? ? ? ? ? ? showData: [], //顯示的數(shù)據(jù)
? ? ? ? ? ? pagesize: 3, //一頁的數(shù)據(jù)條數(shù)
? ? ? ? ? ? currentPage: 1, //當前頁是從哪頁開始
? ? ? ? ? ? companyData: [
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? name: "企業(yè)名稱1",
? ? ? ? ? ? ? ? ? ? date: "2016-05-04",
? ? ? ? ? ? ? ? ? ? publishNumber: 12,
? ? ? ? ? ? ? ? ? ? checkTimes: 10,
? ? ? ? ? ? ? ? ? ? RecruitmentTimes: 110,
? ? ? ? ? ? ? ? ? ? windowPublishTimes: 120,
? ? ? ? ? ? ? ? ? ? companyStatus: 0,
? ? ? ? ? ? ? ? },
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? name: "企業(yè)名稱2",
? ? ? ? ? ? ? ? ? ? date: "2016-05-04",
? ? ? ? ? ? ? ? ? ? publishNumber: 12,
? ? ? ? ? ? ? ? ? ? checkTimes: 10,
? ? ? ? ? ? ? ? ? ? RecruitmentTimes: 110,
? ? ? ? ? ? ? ? ? ? windowPublishTimes: 120,
? ? ? ? ? ? ? ? ? ? companyStatus: 0,
? ? ? ? ? ? ? ? },
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? name: "企業(yè)名稱3",
? ? ? ? ? ? ? ? ? ? date: "2016-05-04",
? ? ? ? ? ? ? ? ? ? publishNumber: 12,
? ? ? ? ? ? ? ? ? ? checkTimes: 10,
? ? ? ? ? ? ? ? ? ? RecruitmentTimes: 110,
? ? ? ? ? ? ? ? ? ? windowPublishTimes: 120,
? ? ? ? ? ? ? ? ? ? companyStatus: 1,
? ? ? ? ? ? ? ? },
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? name: "企業(yè)名稱4",
? ? ? ? ? ? ? ? ? ? date: "2016-05-04",
? ? ? ? ? ? ? ? ? ? publishNumber: 12,
? ? ? ? ? ? ? ? ? ? checkTimes: 10,
? ? ? ? ? ? ? ? ? ? RecruitmentTimes: 110,
? ? ? ? ? ? ? ? ? ? windowPublishTimes: 120,
? ? ? ? ? ? ? ? ? ? companyStatus: 1,
? ? ? ? ? ? ? ? },
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? name: "企業(yè)名稱5",
? ? ? ? ? ? ? ? ? ? date: "2016-05-04",
? ? ? ? ? ? ? ? ? ? publishNumber: 12,
? ? ? ? ? ? ? ? ? ? checkTimes: 10,
? ? ? ? ? ? ? ? ? ? RecruitmentTimes: 110,
? ? ? ? ? ? ? ? ? ? windowPublishTimes: 120,
? ? ? ? ? ? ? ? ? ? companyStatus: 1,
? ? ? ? ? ? ? ? },
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? name: "企業(yè)名稱6",
? ? ? ? ? ? ? ? ? ? date: "2016-05-04",
? ? ? ? ? ? ? ? ? ? publishNumber: 12,
? ? ? ? ? ? ? ? ? ? checkTimes: 10,
? ? ? ? ? ? ? ? ? ? RecruitmentTimes: 110,
? ? ? ? ? ? ? ? ? ? windowPublishTimes: 120,
? ? ? ? ? ? ? ? ? ? companyStatus: 1,
? ? ? ? ? ? ? ? },
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? name: "企業(yè)名稱7",
? ? ? ? ? ? ? ? ? ? date: "2016-05-04",
? ? ? ? ? ? ? ? ? ? publishNumber: 12,
? ? ? ? ? ? ? ? ? ? checkTimes: 10,
? ? ? ? ? ? ? ? ? ? RecruitmentTimes: 110,
? ? ? ? ? ? ? ? ? ? windowPublishTimes: 120,
? ? ? ? ? ? ? ? ? ? companyStatus: 1,
? ? ? ? ? ? ? ? },
? ? ? ? ? ? ],
? ? ? ? };
? ? },
? ? methods: {
? ? ? ? //選擇頁
? ? ? ? handleCurrentChange(val) {
? ? ? ? ? ? this.currentPage = val; //動態(tài)改變
? ? ? ? ? ? this.showData = this.companyData.slice(
? ? ? ? ? ? ? ? (this.currentPage - 1) * this.pagesize,
? ? ? ? ? ? ? ? this.currentPage * this.pagesize
? ? ? ? ? ? );
? ? ? ? },
? ? ? ? //上一頁
? ? ? ? upChange(val) {
? ? ? ? ? ? console.log(val);
? ? ? ? ? ? this.currentPage -= 1; //動態(tài)改變
? ? ? ? ? ? this.showData = this.companyData.slice(
? ? ? ? ? ? ? ? (this.currentPage - 1) * this.pagesize,
? ? ? ? ? ? ? ? this.currentPage * this.pagesize
? ? ? ? ? ? );
? ? ? ? },
? ? ? ? //下一頁
? ? ? ? nextChange(val) {
? ? ? ? ? ? this.currentPage += 1; //動態(tài)改變
? ? ? ? ? ? this.showData = this.companyData.slice(
? ? ? ? ? ? ? ? (this.currentPage - 1) * this.pagesize,
? ? ? ? ? ? ? ? this.currentPage * this.pagesize
? ? ? ? ? ? );
? ? ? ? },
?
? ? },
};
</script>

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

相關(guān)文章

  • element-ui表格如何自適應(yīng)高度效果示例

    element-ui表格如何自適應(yīng)高度效果示例

    這篇文章主要給大家介紹了關(guān)于element-ui表格如何自適應(yīng)高度的相關(guān)資料,Element UI的Table組件默認情況下是沒有自適應(yīng)高度的,文中給大家介紹了解決的辦法,需要的朋友可以參考下
    2023-08-08
  • vue.js父子組件通信動態(tài)綁定的實例

    vue.js父子組件通信動態(tài)綁定的實例

    今天小編就為大家分享一篇vue.js父子組件通信動態(tài)綁定的實例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-09-09
  • 利用Vue3封裝一個彈框組件簡單嗎

    利用Vue3封裝一個彈框組件簡單嗎

    最近在項目中自己封裝的一個記錄一下,下面這篇文章主要給大家介紹了關(guān)于利用Vue3封裝一個彈框組件的相關(guān)資料,文中通過實例代碼介紹的非常詳細,需要的朋友可以參考下
    2021-12-12
  • vue-router相關(guān)基礎(chǔ)知識及工作原理

    vue-router相關(guān)基礎(chǔ)知識及工作原理

    這篇文章主要介紹了vue-router相關(guān)基礎(chǔ)知識及單頁面應(yīng)用的工作原理,需要的朋友可以參考下
    2018-03-03
  • vue引入axios同源跨域問題

    vue引入axios同源跨域問題

    這篇文章主要介紹了vue引入axios同源跨域問題,文章給大家提供了解決方案,非常不錯,具有一定的參考借鑒價值,需要的朋友可以參考下
    2018-09-09
  • Vue?props傳入function時的this指向問題解讀

    Vue?props傳入function時的this指向問題解讀

    這篇文章主要介紹了Vue?props傳入function時的this指向問題解讀,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-01-01
  • 深入理解Vue transition源碼分析

    深入理解Vue transition源碼分析

    本篇文章主要介紹了深入理解Vue transition源碼分析,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-07-07
  • vue動態(tài)改變背景圖片demo分享

    vue動態(tài)改變背景圖片demo分享

    今天小編就為大家分享一篇vue動態(tài)改變背景圖片demo分享,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-09-09
  • vue使用Vue.extend創(chuàng)建全局toast組件實例

    vue使用Vue.extend創(chuàng)建全局toast組件實例

    這篇文章主要介紹了vue使用Vue.extend創(chuàng)建全局toast組件實例,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-03-03
  • vue中實現(xiàn)Monaco Editor自定義提示功能

    vue中實現(xiàn)Monaco Editor自定義提示功能

    最近小編接到一個項目,需要在瀏覽器的ide中支持自定義提示功能,接下來通過本文給大家介紹在vue中實現(xiàn)Monaco Editor自定義提示功能,需要的朋友可以參考下
    2019-07-07

最新評論