在Vue項(xiàng)目中使用Element-UI如何實(shí)現(xiàn)一個(gè)分頁顯示效果?很多新手對(duì)此不是很清楚,為了幫助大家解決這個(gè)難題,下面小編將為大家詳細(xì)講解,有這方面需求的人可以來學(xué)習(xí)下,希望你能有所收獲。
當(dāng)我們從后端返回的數(shù)據(jù)量很大,并且根據(jù)需求我們需要將返回的數(shù)據(jù)全部都顯示在頁面中,默認(rèn)情況下會(huì)把所有的數(shù)據(jù)全部顯示在一個(gè)頁面,這樣非常影響視覺和頁面的使用,所以需要使用分頁
我這次使用的是Vue4.0 + Element-UI組件,Element-UI庫非常的豐富,它提供了一個(gè)分頁組件 Pagination
展示效果:這個(gè)是獲取兩個(gè)時(shí)間段的上機(jī)記錄
HTML部分:
<el-card> <div class="block"> <span > <span class="demonstration" style='margin-right:10px'> 開始日期 </span> <el-date-picker v-model="value1" type="datetime" placeholder="選擇日期" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd hh:mm:ss"> </el-date-picker> </span> <span > <span class="demonstration" style='margin-right:10px'> 截止日期</span> <el-date-picker v-model="value2" type="datetime" placeholder="選擇日期" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd hh:mm:ss"> </el-date-picker> </span> <el-button type="primary" @click="lineCrodList"> 搜索 </el-button> </div> <el-table :data="lineData" > <el-table-column prop="onTime" label="上機(jī)時(shí)間"> </el-table-column> <el-table-column prop="downTime" label="下機(jī)時(shí)間"> </el-table-column> <el-table-column prop="spendCash" label="花費(fèi)時(shí)間"> </el-table-column> <el-table-column prop="spendCash" label="花費(fèi)金額"> </el-table-column> </el-table> <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[1, 2, 5, 10]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> </el-card>
新聞標(biāo)題:在Vue項(xiàng)目中使用Element-UI如何實(shí)現(xiàn)一個(gè)分頁顯示效果-創(chuàng)新互聯(lián)
本文路徑:http://jinyejixie.com/article12/hegdc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供移動(dòng)網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)公司、響應(yīng)式網(wǎng)站、企業(yè)建站、網(wǎng)站收錄、全網(wǎng)營銷推廣
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容