ANT DESIGN VUR table添加滚动条
<a-table
:scroll="{ y: 100 }" //设置表格高
:customRow="customRow" //设置隔行变色
:pagination="false" // 默认不出现分页
:columns="subnetAddressTable" //表头
:data-source="subnetAddressData" //表数据
>
</a-table>
设置滚动条样式:
//表格滚动条
/deep/.ant-table-body {
overflow-x: hidden;
&::-webkit-scrollbar {
/*滚动条整体样式*/
width: 5px;
height: 1px;
}
&::-webkit-scrollbar-thumb {
/*滚动条里面的滑块*/
border-radius: 5px;
background: rgba(100, 177, 240, 0.5);
}
&::-webkit-scrollbar-track {
/*滚动条里面轨道背景*/
border-radius: 5px;
background: rgba(0, 0, 0, 0.1);
}
}
(遇到问题)滚动条无论几条数据一直在
去掉方法
/deep/.ant-table-fixed-header > .ant-table-content > .ant-table-scroll > .ant-table-body {
overflow-y: auto !important;
}