雖然在官方文檔中沒有給出這個(gè)組件,但是在源碼中是有的。所以我們可以直接使用:
<el-scrollbar></el-scrollbar>
但是我們需要微調(diào)一下樣式,兩種情況的演示代碼如下:
已知內(nèi)容高度
<div style='height:800px'><el-scrollbar class='page-component__scroll'></el-scrollbar><div><style>.page-component__scroll{ height: 100%;}.page-component__scroll .el-scrollbar__wrap { overflow-x: auto;}<style>高度由內(nèi)容撐開
<html> <body> <div style='height:100%'> <el-scrollbar class='page-component__scroll'></el-scrollbar> <div> </body></html><style>html,body{ height:100% overflow:hidden; /*有效防止在頁面進(jìn)行手動(dòng)刷新時(shí)顯示內(nèi)置滾動(dòng)條*/}.page-component__scroll{ height: 100%;}.page-component__scroll .el-scrollbar__wrap { overflow-x: auto;}<style>以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持錯(cuò)新站長站。
新聞熱點(diǎn)
疑難解答
圖片精選