1. 程式人生 > 實用技巧 >Vue -- table多表頭,在表頭中新增按鈕

Vue -- table多表頭,在表頭中新增按鈕

<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
      <el-table-column label="全部使用者">
        <el-table-column type="selection" align="center" label-class-name="allSelection" width="80" />
        <el-table-column :render-header="renderHeader">
          <template slot-scope="scope">
            <div class="user-wrapper">
                <img :src="scope.row.photo" alt="">
                  {{ scope.row.nickName }}
            </div>
          </template>
        </el-table-column>
      </el-table-column>
</el-table>
 renderHeader(h) {
      return (
        <el-button class='filter-item' type='default' size="mini" icon='el-icon-delete' onClick={() => this.handleAddBlackList()} loading={this.changeListLoading}>加入黑名單</el-button>
      )
}