报错如下 runtime-core.esm-bundler.js:41 [Vue warn]: Failed to resolve component: HelloWorld If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. at <UserList onVnodeUnmounted=fn ref=Ref< Proxy {…} > > at at at at at <Index onVnodeUnmounted=fn ref=Ref< Proxy {…} > > at at
因为没使用<script setup>这种方式 使用的是
export default defineComponent({name: 'userList',setup() {。。。这样
需要添加 components: {
HelloWorld, // 注册子组件
},
注册完就可以显示出组件了