Browse Source

edit el-table-column

master
taylor 8 years ago
parent
commit
fdbef517b5
  1. 14
      src/pages/nav1/Table.vue

14
src/pages/nav1/Table.vue

@ -31,11 +31,11 @@
</el-table-column>
<el-table-column prop="addr" label="地址" min-width="180" sortable>
</el-table-column>
<el-table-column inline-template :context="_self" label="操作" width="150">
<span>
<el-button size="small" @click="handleEdit(row)">编辑</el-button>
<el-button type="danger" size="small" @click="handleDel(row)">删除</el-button>
</span>
<el-table-column label="操作" width="150">
<template scope="scope">
<el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -181,7 +181,7 @@
});
},
//
handleDel: function (row) {
handleDel: function (index, row) {
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
@ -203,7 +203,7 @@
});
},
//
handleEdit: function (row) {
handleEdit: function (index, row) {
this.editFormVisible = true;
this.editForm = Object.assign({}, row);
},

Loading…
Cancel
Save