最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

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

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

頁面中渲染的數(shù)據(jù)不是所有數(shù)據(jù),是需要展示的數(shù)據(jù),即當(dāng)前頁的數(shù)據(jù),默認(rèn)第一頁的數(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="編號(hào)"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?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="注冊時(shí)間"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?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中代碼段(分頁部分,與上一段代碼同層級(jí))

<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>

下面是邏輯實(shí)現(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, //當(dāng)前頁是從哪頁開始
? ? ? ? ? ? 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; //動(dòng)態(tài)改變
? ? ? ? ? ? this.showData = this.companyData.slice(
? ? ? ? ? ? ? ? (this.currentPage - 1) * this.pagesize,
? ? ? ? ? ? ? ? this.currentPage * this.pagesize
? ? ? ? ? ? );
? ? ? ? },
? ? ? ? //上一頁
? ? ? ? upChange(val) {
? ? ? ? ? ? console.log(val);
? ? ? ? ? ? this.currentPage -= 1; //動(dòng)態(tài)改變
? ? ? ? ? ? this.showData = this.companyData.slice(
? ? ? ? ? ? ? ? (this.currentPage - 1) * this.pagesize,
? ? ? ? ? ? ? ? this.currentPage * this.pagesize
? ? ? ? ? ? );
? ? ? ? },
? ? ? ? //下一頁
? ? ? ? nextChange(val) {
? ? ? ? ? ? this.currentPage += 1; //動(dòng)態(tài)改變
? ? ? ? ? ? this.showData = this.companyData.slice(
? ? ? ? ? ? ? ? (this.currentPage - 1) * this.pagesize,
? ? ? ? ? ? ? ? this.currentPage * this.pagesize
? ? ? ? ? ? );
? ? ? ? },
?
? ? },
};
</script>

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

相關(guān)文章

  • 15 分鐘掌握vue-next響應(yīng)式原理

    15 分鐘掌握vue-next響應(yīng)式原理

    這篇文章主要介紹了15 分鐘掌握vue-next響應(yīng)式原理,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-10-10
  • vue.js刪除動(dòng)態(tài)綁定的radio的指定項(xiàng)

    vue.js刪除動(dòng)態(tài)綁定的radio的指定項(xiàng)

    這篇文章主要介紹了vue.js刪除動(dòng)態(tài)綁定的radio的指定項(xiàng),需要的朋友可以參考下
    2017-06-06
  • vue3中的組件間的傳值(props)

    vue3中的組件間的傳值(props)

    這篇文章主要介紹了vue3中的組件間的傳值(props)問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-04-04
  • cordova+vue+webapp使用html5獲取地理位置的方法

    cordova+vue+webapp使用html5獲取地理位置的方法

    這篇文章主要介紹了
    2019-07-07
  • Vue+ElementUI?實(shí)現(xiàn)分頁功能-mysql數(shù)據(jù)

    Vue+ElementUI?實(shí)現(xiàn)分頁功能-mysql數(shù)據(jù)

    這篇文章主要介紹了Vue+ElementUI?實(shí)現(xiàn)分頁查詢-mysql數(shù)據(jù),當(dāng)數(shù)據(jù)庫中數(shù)據(jù)比較多時(shí),就每次只查詢一部分來緩解服務(wù)器和頁面壓力。這里使用elementui的?Pagination?分頁?組件,配合mysql的limit語句,實(shí)現(xiàn)分頁查詢mysql數(shù)據(jù),下面來看看具體實(shí)現(xiàn)過程,希望對(duì)大家學(xué)習(xí)有所幫助
    2021-12-12
  • electron踩坑之dialog中的callback解決

    electron踩坑之dialog中的callback解決

    這篇文章主要介紹了electron踩坑之dialog中的callback解決,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-10-10
  • vue-admin-element項(xiàng)目突然就起不來了的解決

    vue-admin-element項(xiàng)目突然就起不來了的解決

    這篇文章主要介紹了vue-admin-element項(xiàng)目突然就起不來了的解決方案,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-10-10
  • Vue權(quán)限指令控制權(quán)限詳解

    Vue權(quán)限指令控制權(quán)限詳解

    因?yàn)轫?xiàng)目中需要根據(jù)后端返回的權(quán)限進(jìn)行功能的顯示隱藏,所以就加了個(gè)權(quán)限指令。不用寫if else進(jìn)行判斷,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧
    2022-09-09
  • Vue.prototype全局變量的實(shí)現(xiàn)示例

    Vue.prototype全局變量的實(shí)現(xiàn)示例

    在Vue中可以使用Vue.prototype向Vue的全局作用域添加屬性或方法,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2024-06-06
  • vue3項(xiàng)目中使用tinymce的方法

    vue3項(xiàng)目中使用tinymce的方法

    這篇文章主要介紹了vue3使用tinymce的方法,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2023-04-04

最新評(píng)論

东至县| 长白| 五寨县| 双城市| 健康| 清徐县| 紫金县| 安西县| 杂多县| 邢台市| 平邑县| 那坡县| 阳高县| 开封市| 安福县| 威海市| 浦县| 泗阳县| 冷水江市| 三江| 文水县| 灵武市| 嘉鱼县| 乐昌市| 屏东县| 新郑市| 闸北区| 林州市| 乐昌市| 甘肃省| 丘北县| 石阡县| 永清县| 朝阳区| 石泉县| 湖口县| 玉屏| 景谷| 玛沁县| 武清区| 庆城县|