Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 06c7674

Browse files
committed
fix(install): global properties for vue2 installation
1 parent 59720c8 commit 06c7674

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/dynamicForms.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { App, isVue2 } from 'vue-demi';
1+
import { App, isVue3 } from 'vue-demi';
22
import { dynamicFormsSymbol } from './useApi';
33
import DynamicForm from './components/dynamic-form/DynamicForm.vue';
44
import { FormOptions } from './core/models';
@@ -21,16 +21,12 @@ export function createDynamicForms(
2121
install(app: App) {
2222
const self = this;
2323

24-
if (isVue2) {
25-
// Vue 2 only
26-
console.log('IS VUEEEE 222');
24+
app.component('dynamic-form', DynamicForm);
25+
if (isVue3) {
26+
app.provide(dynamicFormsSymbol, self);
2727
} else {
28-
// Vue 3 only
29-
console.log('IS VUEEEE 333');
28+
app.config.globalProperties.$vdf = self;
3029
}
31-
32-
app.component('dynamic-form', DynamicForm);
33-
app.provide(dynamicFormsSymbol, self);
3430
},
3531
};
3632

0 commit comments

Comments
 (0)