Skip to content

Commit

Permalink
fix: 防止VueCompositionAPI重复注册 (#809)
Browse files Browse the repository at this point in the history
  • Loading branch information
cong-min authored Apr 27, 2022
1 parent c1e5133 commit 50a2c78
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import VueCompositionAPI from '@vue/composition-api';
import * as components from './components';

function install(Vue: VueConstructor, config?: object) {
Vue.use(VueCompositionAPI);
if (Vue._installedPlugins.indexOf(VueCompositionAPI) === -1) {
Vue.use(VueCompositionAPI);
}
Object.keys(components).forEach((key) => {
if (components[key]) {
/plugin/i.test(key) ? Vue.use(components[key]) : Vue.use(components[key], config);
Expand Down

0 comments on commit 50a2c78

Please sign in to comment.