vue封装el-table问题?

数据源如下

 tableData: [
        {
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄',
        },
        {
          date: '2016-05-04',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄',
        },
        {
          date: '2016-05-01',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1519 弄',
        },
        {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1516 弄',
        },
      ],
      cols: [
        {
          prop: 'date',
          label: '日期',
          otherProps: {
            type: 'index',
            align: 'center',
          },
        },
        {
          prop: 'name',
          label: '姓名',
          otherProps: {
            type: 'index',
            align: 'center',
          },
        },
        {
          prop: 'address',
          label: '地址',
        },
        {
          prop: 'action',
          label: '操作',
          btnList: [
            {
              label: '编辑',
              click:'add',
              originProps: {
                type: 'text',
                style: { color: '#2478E9' },
              },
            },
            {
              label: '删除',
            },
          ],
        },
      ],

image.png
image.png
当给模板添加上slot-scope时,列数据就不显示了,没有报错,应该如何修改

阅读 1.6k
1 个回答

slot部分

<template v-if="col.btnList" v-slot="scope">
.....
</template>

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