如何将组件与VUE CLI3中的全局寄存器一起使用
夹
+src
+components
+Logo.vue
App.vue
main.js
我的main.js中的文件
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import Logo from '@/components/Logo.vue'
createApp(App).use(router).mount('#app')
这是
<template>
<div>
<Logo />
</div>
</template>
<script>
export default {
}
</script>
<style lang="scss" scoped>
</style>
。
This is my folder
+src
+components
+Logo.vue
App.vue
main.js
In my main.js I had been import the file
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import Logo from '@/components/Logo.vue'
createApp(App).use(router).mount('#app')
This is my App.vue
<template>
<div>
<Logo />
</div>
</template>
<script>
export default {
}
</script>
<style lang="scss" scoped>
</style>
And I was stucked at how to link my Logo.vue into App.vue
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过以下方式在全球注册组件:
示例:
在官方。
You can register the component globally by using:
Example:
Read more in the official docs.