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>

 

posted on 2022-06-19 13:08  大话人生  阅读(2596)  评论(0)    收藏  举报