<el-table
:data="inputValueDate"
border
stripe
style="width: 100%;"
>
<el-table-column
v-for="(item1,index1) in item.optionsList"
:key="index1"
:label="item1.optionValue"
:property="item1.optionName"
>
<template slot-scope="scope">
<el-input
v-model="scope.row[scope.column.property]"
size="small"
style="width:100%"
></el-input>
</template>
</el-table-column>
<el-table-column label="操作" min-width="30%">
<template slot-scope="scope">
<span @click="deleteData1(scope.row,scope.$index)">
<a href="javascript:;">删除</a>
</span>
</template>
</el-table-column>
</el-table>
表头的数据是这样的--包括label和props
image.png
最重要的代码是这部分
<el-table-column
v-for="(item1,index1) in item.optionsList"
:key="index1"
:label="item1.optionValue"
:property="item1.optionName"
>
<template slot-scope="scope">
<el-input
v-model="scope.row[scope.column.property]"
size="small"
style="width:100%"
></el-input>
</template>
</el-table-column>
网友评论