动态表头文字显示-elementUI

<el-table-column
          label="search.year + '年'"
          width="49"
          align="center"
    :render-header="yearHeader"
></el-table-column>

 

 
methods: {
  yearHeader(h, { column, $index }) {
      return h('div', {
        attrs: {
          class: 'cell'
        },
        domProps: {
         innerHTML: column.label + '年'
        }
      });
    }
  }
}
 
 
 
// 该功能用在动态加载表格
yearHeader(h, { column, $index }) {
      // return h('div', {
      //   attrs: {
      //     class: 'cell'
      //   },
      //   domProps: {
      //     innerHTML: column.label + '年'
      //   }
      // });
    }
  }
posted @ 2021-03-04 18:01  Deer_Lin  阅读(230)  评论(0)    收藏  举报