-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ic-formly): change ic-formly to plugin
- Loading branch information
Walker Leite
committed
Dec 22, 2017
1 parent
b3c98db
commit be581bd
Showing
7 changed files
with
48 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Vue from 'vue' | ||
import IcFormly from './src' | ||
|
||
Vue.use(IcFormly) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import VueFormly from 'vue-formly' | ||
import VueFormlyBootstrap from 'vue-formly-bootstrap' | ||
import IcFormly from './ic-formly/ic-formly.vue'; | ||
|
||
let Formly = { | ||
getTypes: VueFormly.getTypes, | ||
addType: VueFormly.addType, | ||
addValidationMessage: VueFormly.addValidationMessage, | ||
install(Vue, options) { | ||
|
||
// install Vueformly | ||
VueFormly.install(Vue, options) | ||
VueFormlyBootstrap.install(Vue, options) | ||
|
||
// add our components | ||
Vue.component('ic-formly', IcFormly) | ||
} | ||
}; | ||
|
||
//auto install | ||
if (typeof window !== 'undefined' && window.Vue) { | ||
setTimeout(() => console.log(window.Vue), 3000) | ||
|
||
window.Vue.use(Formly); | ||
//expose formly functions if auto installed | ||
window.Vue.$formly = { | ||
getTypes: VueFormly.getTypes, | ||
addType: VueFormly.addType, | ||
addValidationMessage: VueFormly.addValidationMessage | ||
}; | ||
} | ||
|
||
|
||
export default Formly; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters