Element-UI 可编辑表格 + 动态表头
利用el-table-column的自定义列模板可以与其他组件使用实现复杂的表格。
由于我想实现一个可编辑的表格,同时因为表格有很多个,同时列名也是不一样的(数量和名称),所以想偷个赖写个动态的切换的功能。
`
<el-button @click=“change”>测试按钮
<el-table-column v-for=“item in tableHead”:label=“item.label” :property=“item.property”
width=“180”>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
size="mini"
@click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button
size="mini"
type="danger"
@click="handleDelete(scope.$index, scope.row)">删除</el-button>