多维数据怎么循环el-table-column?

列表需要循环一个数组,数组里的对象有子数组也需要循环到表头和值,代码如下。这样写报错,循环不出来怎么办?

 <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>
阅读 2.3k
1 个回答

image.png
这里el-table不能直接嵌套template 不能这么用
你这种需求做过一个, 将两个数组拆开了, 表头一个, 数据一个

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题