已有默认插槽,后代会被忽略:Extraneous children found when component already has explicitly named default slot
报错Extraneous children found when component already has explicitly named default slot.These children will be ignored.vue(39)解决办法就是加上尾标签。
·
Vue3+element-plus:
报错Extraneous children found when component already has explicitly named default slot.These children will be ignored.vue(39)
可能一:template包裹有误,例:
报错部分:
错误代码:
原因:具名插槽包裹标签范围有误,正确代码:
可能二:缺少尾标签
例如下面错误例子
<el-column />
<template #default='scope'>
解决办法就是加上尾标签
<el-column>
<template #default='scope'>
</el-column>
更多推荐
已为社区贡献1条内容
所有评论(0)