vuejs / composition-api

Composition API plugin for Vue 2
https://composition-api.vuejs.org/
MIT License
4.19k stars 343 forks source link

How to avoid duplicate register composition-api ? #974

Closed vanclimber closed 1 year ago

vanclimber commented 1 year ago

My project was build by vite, and it was registed vomposition-api ,such as this:

import Vue from 'vue';
import VCA from '@vue/composition-api';

Vue.use(VCA);
window.Vue = Vue;
...

Then,My component will register composition-api by CDN , because it is not sure if the project is ready rigisted composition-api.(I know this is a strange way)

now, my project(window.Vue ) has been registed compostion-api twice,beause there are two different composition-api.

after that, when each component is created, setup will executed twice.

how to avoid this condition if I only want register composition-api once?

github-actions[bot] commented 1 year ago

Stale issue message