1.el-table中使用:
<el-table :data="tableData" border stripe :header-cell-class-name="headerBg">
2.在return中返回:
export default { name: 'Home', data(){ const item = { date: '2016-05-02', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄' }; return{ tableData: Array(10).fill(item), collapseBtnClass: 'el-icon-s-fold', isCollapse: false, sideWidth: 200, logoTextShow:true, headerBg:"headerBg" } },
3.在style 中添加
<style> .headerBg { background: #42b983!important; } </style>
浙公网安备 33010602011771号