被 Element UI 的 Table 的滚动条折腾了半天。
现象:刷新整个页面后,滚动条不会出现。

问题的原因:有一列是图片,图片加载完后会撑高了 el-table,但是 el-table 没有重绘,所以滚动条不会出现。
解决的方法很简单:给图片固定的高度:40px,宽度自适应。
<div class="page">
<div class="page__header"></div>
<div class="page_body">
<el-column>
<template slot-scope="scope">
<el-image class="page__cover" :src="scope.row.cover" />
</template>
</el-column>
</div>
<el-pagination class="page_footer" />
</div>
<style scoped lang="scss">
.page {
display: flex;
flex-direction: column;
&__header {
margin-bottom: 20px;
}
&__body {
flex: 1 1 0;
}
&__cover {
height: 40px;
aspect-ratio: 364 / 426;
}
}
</style>