列表需要循环一个数组,数组里的对象有子数组也需要循环到表头和值,代码如下。这样写报错,循环不出来怎么办?
<el-table :data="rowlist" border>
<template slot-scope="scope">
<el-table-column
v-for="(item, index) in scope.row.specs"
:key="index"
:label="item.name"
:prop="item.value"
align="center"
width="120"
>
<template>
<el-input v-model="item.value" clearable size="small" />
</template>
</el-table-column>
</template>
</el-table>
这里el-table不能直接嵌套template 不能这么用
你这种需求做过一个, 将两个数组拆开了, 表头一个, 数据一个