第一種方法:會出現(xiàn)警告?[Element Warn][TableColumn]Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header.
1.在<el-table-column>上定義:render-header調(diào)用自定義表頭方法舱禽,如圖舉例
2.在methods:{}方法里面自定義表頭方法满葛,如圖舉例
第二種方法: 使用scoped-slot(更簡單且簡潔無警告)
1.在<el-table-column>上使用scoped-slot
2.<template>綁定slot,然后自定義你所需要的內(nèi)容
如圖舉例