重寫一個同名樣式,去覆蓋iview table 中某個樣式,卻沒有效果!
<style scoped> .ivu-table-cell { padding-left: 2px; padding-right: 2px; overflow: hidden; text-overflow: ellipsis; white-space: normal; word-break: break-all; box-sizing: border-box; } </style>
需要去掉scoped ,然後給添加class類名稱,限制作用域,防止影響其它頁面。
.weather-table .ivu-table-cell { padding-left: 2px; padding-right: 2px; overflow: hidden; text-overflow: ellipsis; white-space: normal; word-break: break-all; box-sizing: border-box; } .weather-table .ivu-table-small td { height: 36px; }
應用案例:
<Table size="small" class='weather-table' :height="tableHeight" :columns="minuteColumns" :data="minuteData" ref="table"></Table>