代码:
<el-table
class="show_table"
border
:key="itemKey"
:data="shopWindowTable"
:header-cell-style="headerStyle"
:row-style="{ height: '50px' }"
:cell-style="{ padding: '2px' }"
v-loading="loading"
height="500"
highlight-current-row
>
<style scoped>
.show_table {
position: relative;
width: 100%;
overflow: auto;
}
</style>
如截图,表格里内容超出表格大小,css中加了 overflow: auto 但没有出现滚动条。
解决办法:
把el-table标签里的height换到css样式中,滚动条正常显示。
.show_table {
position: relative;
width: 100%;
height: 500px; //高度加到这里
overflow: auto;
}