TypeError: ctx.injections.tableRoot.$scopedSlots[ctx.props.column.slot] is not a function报错

报错:TypeError: ctx.injections.tableRoot.$scopedSlots[ctx.props.column.slot] is not a function

 

 原因:iview table组件columns设置了插槽,但页面table并没有引用

 

加上就不会报错啦 

​
<Table stripe border :columns="table_columns" :data="table_data">

    <template slot-scope="{ row, index }" slot="discount"></template>

</Table>

​

​​​​​​​

table_columns: [
    {
        title: '实际折扣',
        key: 'discount',
        align: 'center',
        slot: 'discount'
     }
]

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
这个错误是因为在使用 ant-design-vuetable 组件渲染表格数据时,给 dataSource 属性传递了一个对象而不是数组。根据引用\[1\]中的解决方法,你需要将 seldata 的赋值改为使用 push 方法添加数据到 seldata 中,而不是直接赋值为一个对象。具体来说,你需要将 seldata=row 改为 seldata.push(row)。这样就能解决这个错误了。引用\[1\]中还提到了其他一些相关的信息,比如使用 Element-UI 组件进行开发时也可能出现类似的问题,以及一些关于数组操作函数的返回值的总结。但是这些信息与你的问题没有直接关联,所以在回答中不需要引用到它们。 #### 引用[.reference_title] - *1* [Error in render: “TypeError: data.slice is not a function](https://blog.csdn.net/qq_52855464/article/details/125995353)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [[Vue warn]: Error in render: “TypeError: data.reduce is not a function报错详解](https://blog.csdn.net/weixin_44370837/article/details/121034549)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值