how to import and use other components in a component loaded from vue3-sfc-loader?

2.4k Views Asked by At

I am using vue3-sfc-loader. I can get it working, but I am unable to use other components (also loaded from the same plugin) inside of a component. I have gone through documentation and searched whole day, but I am not able to figure out what am I missing.

1

There are 1 best solutions below

1
Tariq Abdullah On BEST ANSWER

I found the answer. Answering for anyone needing it.

You can use import statement with relative path to your another component inside script tag of your SFC.

Also, you need to include the component in list of components you want to use.

import currency from './currency.vue';
export default ({
    props: {
        ...
    },
    components: {
        'currency': currency
    },
    setup() {
        
    },
    ...

Although someone in discussions on githhub mentions that you can use import statements.. it doesn't work.