原因:转vue3后代码script使用的是setup,未设置name。
<script setup>
defineOptions({
name: 'xxxx',
})
</script>
类比vue2中的
<script>
export default {
name: "xxxx",
}
</script>
本文讨论了从Vue2迁移到Vue3时,如何在使用`<scriptsetup>`标签的组件中正确设置`name`属性,对比了与传统`exportdefault`语法的区别。
原因:转vue3后代码script使用的是setup,未设置name。
<script setup>
defineOptions({
name: 'xxxx',
})
</script>
类比vue2中的
<script>
export default {
name: "xxxx",
}
</script>
1472

被折叠的 条评论
为什么被折叠?