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

Commit

Permalink
Merge pull request #214 from asigloo/feature/vue-demi-test
Browse files Browse the repository at this point in the history
Feature/vue demi test
  • Loading branch information
alvarosabu authored Dec 31, 2020
2 parents ac879f0 + 440a5b5 commit d9d7de5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@
"vue": "^3.0.4",
"vue-select": "3.10.8",
"postcss": "^7.0.35",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.1"
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.1",
"autoprefixer": "^9.8.6"
},
"dependencies": {
"autoprefixer": "^9.8.6",
"deep-clone": "^3.0.3",
"deep-object-diff": "^1.1.0",
"vue-demi": "^0.5.3"
Expand Down
14 changes: 5 additions & 9 deletions src/dynamicForms.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App, isVue2 } from 'vue-demi';
import { App, isVue3 } from 'vue-demi';
import { dynamicFormsSymbol } from './useApi';
import DynamicForm from './components/dynamic-form/DynamicForm.vue';
import { FormOptions } from './core/models';
Expand All @@ -21,16 +21,12 @@ export function createDynamicForms(
install(app: App) {
const self = this;

if (isVue2) {
// Vue 2 only
console.log('IS VUEEEE 222');
app.component('dynamic-form', DynamicForm);
if (isVue3) {
app.provide(dynamicFormsSymbol, self);
} else {
// Vue 3 only
console.log('IS VUEEEE 333');
app.config.globalProperties.$vdf = self;
}

app.component('dynamic-form', DynamicForm);
app.provide(dynamicFormsSymbol, self);
},
};

Expand Down

0 comments on commit d9d7de5

Please sign in to comment.