Element Plus 的 Table 组件本身不提供内置的编辑功能。但是可以通过结合 Table 组件和 Form 组件来实现行级别的可编辑功能
<template>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="date" label="日期" width="180">
<template #default="scope">
<el-input v-model="scope.row.date" size="small"></el-input>
</template>
</el-table-column>
<el-table-column prop="name" label="姓名" width="180">
<template #default="scope">
<el-input v-model="scope.row.name" size="small"></el-input>
</template>
</el-table-column>
<el-table-column prop="address" label="地址">
<template #default="scope">
<el-input v-model="scope.row.address" size="small"></el-input>
</template>
</el-table-column>
</el-table>
</template>
<script setup>
import { reactive } from 'vue';
const tableData = reactive([
{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
},
{
date: '2016-05-04',
name: '张小刚',
address: '上海市普陀区金沙江路 1517 弄'
},
]);
</script>
标签:reactive,普陀区,05,element,编辑,plus,组件,table
From: https://www.cnblogs.com/qcy-blog/p/18451019