<el-table
:data="tableData"
border
:header-cell-style="{background:'#f5f7fa',color:'#909399'}"
style="width: 100%">
<el-table-column prop="date" label="日期" align="center"></el-table-column>
<el-table-column prop="name" label="姓名" align="center">
<template slot-scope="scope">
<el-input
v-if="scope.row.cellNameVisible"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
v-model="scope.row.name"
@blur="blurEvent(scope.row,'cellNameVisible')"/>
<span class="el-span" v-else @click.stop="cellClick(scope.row,'cellNameVisible')">{
{ scope.row.name }}</span>
</template>
</el-table
Vue实现点击表格单元格出现输入框,失去焦点隐藏输入框功能,变回文本
最新推荐文章于 2024-05-14 19:53:07 发布