Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
554 views
in Technique[技术] by (71.8m points)

elemen table height固定表头 +el-scrollbar。

 <el-scrollbar style="width:100%;height:100%">
          <el-table border @row-click="tableRow" height="100" tooltip-effect="dark" :header-cell-style="{background:'#539a98',color:'#fff'}"
              @cell-mouse-enter="rowHoverChangeIn" @cell-mouse-leave="rowHoverChangeOut"
              :data="tableData"
              :show-summary="tableSetting.showSummary"
              highlight-current-row
              v-loading="tableLoading"
              @selection-change="handleSelectionChange"
              @select="handleSelect"
              @select-all="handleSelect"
              style="width: 100%;"
              ref="multipleTable"
              row-key="uuid"
          >
          </el-table>
 </el-scrollbar>

el-scrollbar可以隐藏滚动条,只要我在table 加上height=“100”准备固定表头,前面的el-scrollbar就没效果了,请问是我这样使用的吗?### 问题描述

问题出现的环境背景及自己尝试过哪些方法

相关代码

粘贴代码文本(请勿用截图)

你期待的结果是什么?实际看到的错误信息又是什么?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

去掉 el-scrollbar 标签,在 table 标签上 写个 max-height="xxx" ,若表格所需的高度大于最大高度,则会显示一个滚动条。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...