Vue 3 named imports

I am using Vue 3 with nuxt. A pattern I use quite often (in react) is to create an index file.

export * from 'components/Button'
export * from 'components/Textbox'

then

I can use named imports

import { Button, Textbox } from 'components

is this achievable with .vue files?

hello @roscoeh
No, it’s wrong method.

import ComponentA from './ComponentA.js'

export default {
components: {
ComponentA
},
setup() {
// ...
}
}

for more information please go through this link:-Component Registration | Vue.js
Hope this will help you.

I think you can do something like this:

export { default as Button } from 'components/Button.vue'
export { default as Textbox } from 'components/Textbox.vue'