html表格点击为编辑框,el-table表格内双击或单击单元格编辑输入框、日期等

  • Post author:
  • Post category:其他


需求

在el-table中想要直接点击单元格直接由文字显示变为编辑框状态,而非一整行编辑或者通过展示模态框编辑,这样目标性会比较清楚且页面较简洁。下面直接上代码!

8218e80759f3

实现效果

html代码

@blur=’blurInput(scope.row.id,”name”,scope.row.name)’ v-focus>

{

{scope.row.name}}

type=”date” :clearable=”false” value-format=”yyyy-MM-dd” placeholder=”请选择开始日期”

@blur=’blurInput(scope.row.id,”planStartTime”,scope.row.planStartTime)’ v-focus>

{

{scope.row.planStartTime}}

js代码

export default {

data() {

return {

//表格数据

tableList: [

{

id: 0,

name: “规划许可阶段”,

planStartTime: “2021-0