1<template>
2 <your-component></your-component>
3</template>
4
5<script>
6 import YourComponent from '../components/YourComponent.vue'
7
8 export default {
9 components: {
10 YourComponent // <=> YourComponent: 'YourComponent'
11 }
12 };
13</script>
14
15<!-- OR -->
16
17<script>
18 export default {
19 components: {
20 YourComponent: () => import('your/component/path')
21 }
22 }
23</script>
1// main.js
2import { createApp } from 'vue'
3import App from './App.vue'
4import 'YourComponent' from 'YourFileOrLibrary';
5
6
7const app = createApp(App);
8app.component('yourComponent', YourFileOrLibrary);
9
10// ...