Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How would one use this to support a published Vue 2 component? #10

Open
mirabledictu opened this issue Jun 28, 2021 · 0 comments
Open

Comments

@mirabledictu
Copy link

So we have a published component before, and we do this to publish

vue-cli-service build --target lib --dest dist/lib --name VueComponentName 'src/components/VueComponentName.vue'

Our main.js file is like this:

import Vue from 'vue';
import App from './App.vue';

Vue.config.productionTip = false;

new Vue({
  render: (h) => h(App),
}).$mount('#app');

Just a default main.js file.

Where's the best place to interop the component so when users install it in their Vue 3 app, it will just work without doing interop themselves?

What I mean is they don't have to install vue-2-3 and do themselves this:

import toVue3 from 'vue-2-3/to-vue-3';
import VueComponentName from './VueComponentName';

export default {
    components: {
        VueComponentName: toVue3(VueComponentName)
    }
}

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant