VueJS 3.0 provides new syntax for defining component
import { defineComponent, ref } from 'vue' const HelloWorld = defineComponent(function HelloWorld() { const count = ref(0) return { count } }) How to locally register components with passing function to defineComponent?
In old style you are to use components field in component definition object like this:
import ComponentA from './ComponentA.vue' export default { components: { ComponentA } // ... } 1 Answer
You could do it simply as before by adding that component to components option :
import ComponentA from './ComponentA.vue' export default defineComponent({ setup() { const count = ref(0) return { count } }, components: { ComponentA } });