1.滾動條設置:函數
<el-scrollbar style="height:100%;">.......</el-scrollbar>this
默認會同時出現水平和垂直兩個方向的滾動條,想要隱藏水平方向的滾動條能夠設置以下:spa
.el-scrollbar .el-scrollbar__wrap {
overflow-x: hidden;
}
2.分頁:code
<
el-pagination
background
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:page-size="page_size"
:current-page="currentPage"
:total="total"
layout="total, prev, pager, next"
style="text-align:right; padding: 49px 29px 50px 0;"
></el-pagination>
methods:
handleCurrentChange(val) {
this.param.page = val
this.getMultiTemplate()
},
handleSizeChange(val){
this.param.page_size = val
this.getMultiTemplate()
},
說明:
layout設置: prev
表示上一頁,
next
爲下一頁,
pager
表示頁碼列表,
total
表示總條目數,
size
用於設置每頁顯示的頁碼數量,
background
屬性能夠爲分頁按鈕添加背景色
事件:current-change:currentPage 改變時會觸發;size-change:currentPage 改變時會觸發 函數中返回val即點擊的當前頁
3.因爲加載順序:父組件created→父組件beforeMounted→子組件created→子組件beforeMounted→子組件mounted→父組件mounted,所以會出現加載延遲的狀況,提示「暫無數據」,若是不想顯示「暫無數據」字樣,在el-table中能夠設置爲空字符
empty-text=" ",在tree樹形控件中能夠使用設置爲空字符串:empty-text=""
4.el-table中如何限制某些按鈕爲禁選
使用arguments對象能夠獲取傳入的每一個參數的值, 打印以下:
![](http://static.javashuo.com/static/loading.gif)
實現的代碼以下:對象
![](http://static.javashuo.com/static/loading.gif)