双击输入,确定的table表单
<el-table align="center" :data="templateTable" @row-dblclick="dbclick">
<el-table-column prop="name" label="姓名">
<template slot-scope="scope">
<el-input v-if="scope.row.isOK" v-model="scope.row.name" ></el-input>
<span v-else>{{scope.row.name}}</span>
</template>
</el-table-column>
</el-table>
templateTable: [{
name: '张三',
isOK: false,
},{
name: '李思',
isOK: false,
}],
dbclick(row, event, column) {
row.isOK = !row.isOK
},
版权声明:本文为Aoutlaw原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。