<el-table :data="list" border style="width: 100%" @cell-click="cellclick">
<el-table-column prop="" label="序号">
<template slot-scope="scope">
<el-input ref="gain" size="mini" v-if="scope.row.isOK" @keyup.native.enter="blurClick(scope)" @blur="blurClick(scope)" v-model="scope.row.sort" style="width:100%;hight:100%"></el-input>
<span size="mini" v-else>{{scope.row.sort}}</span>
</template>
</el-table-column>
</el-table>
cellclick(row, column, cell, event) {
if (column.label === "序号") {
this.$set(row, "isOK", true);
}
this.$nextTick(() => {
this.$refs.gain.focus();
});
},
blurClick({ row, column }) {
if (column.label === "序号") {
this.$set(row, "isOK", false);
}
console.log(row, column, "----");
this.top(row.productId, row.sort);
},