<vxe-table
border
show-overflow
ref="xTable" -------------------------------------------可根据此变量控制表格内容
class="vxe-table-element"
height="600"
:data="tableData"--------------------------------表格绑定数据来源
:edit-rules="validRules"--------------------------------验证规则(可不写--则行内不验证)
@cell-dblclick="dbclickFun"----------------------------单元格双击触发方法(可不写)
@edit-closed="saveFun"------------------------------编辑状态关闭触发方法(可不写)
highlight-current-row------------------------------------选中当前行高亮(可不写)
:edit-config="{trigger: 'dblclick', mode: 'row', showStatus: true,autoClear:onedit}"
-----编辑设置(双击触发(可改成单击事件 或不写 手动触发),行事件(也可写成cell 则为单元格事件),显示状态,自动清除状态)
>
<vxe-table-column type="index" width="80">
<template v-slot:header="{ column }">
<span>序号</span>
<i class="el-icon-question"></i>
</template>
</vxe-table-column>
<vxe-table-column
field="name"
title="ElInput"
min-width="140"
:edit-render="{type: 'default'}"
>
<template v-slot:edit="scope">
<el-input v-model="scope.row.name" @input="$refs.xTable.updateStatus(scope)"></el-input>
</
vxe-table 可编辑表格 行内编辑以及验证 集成element-UI
最新推荐文章于 2025-03-29 11:53:25 发布