我的Key是中文的:
const searchResult = ref([ {id:1,'姓名:'张三'},{id:2,'姓名':'李四'},{id:3,'姓名':'王五'},])
const fieldsList = Object.keys(searchResult[0])
<el-table
ref='dataTable'
:data="searchResult"
border>
<!-- 自动生成列,列可以正常显示,自动生成行不行---------->
<el-table-column v-for="item in fieldsList" :key="item" :label= "item">
<template #default="scope">
<!-- 下面是行数据生成 ,这样写报错 -->
<el-input v-show="scope.row.show" v-model="scope.row.item"></el-input>
<span v-show="!scope.row.show">{{scope.row.item}}</span>
</template>
</el-table-column>
</el-table>