Changes the sequence in which plugins are registered
This commit is contained in:
parent
f9378cda25
commit
314b2b054e
2
dist/formulate.esm.js
vendored
2
dist/formulate.esm.js
vendored
File diff suppressed because one or more lines are too long
2
dist/formulate.min.js
vendored
2
dist/formulate.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/formulate.umd.js
vendored
2
dist/formulate.umd.js
vendored
File diff suppressed because one or more lines are too long
@ -61,11 +61,13 @@ class Formulate {
|
|||||||
*/
|
*/
|
||||||
install (Vue, options) {
|
install (Vue, options) {
|
||||||
Vue.prototype.$formulate = this
|
Vue.prototype.$formulate = this
|
||||||
this.options = this.merge(this.defaults, options || {})
|
this.options = this.defaults
|
||||||
if (Array.isArray(this.options.plugins) && this.options.plugins.length) {
|
var plugins = this.defaults.plugins
|
||||||
this.options.plugins
|
if (options && Array.isArray(options.plugins) && options.plugins.length) {
|
||||||
.forEach(plugin => (typeof plugin === 'function') ? plugin(this) : null)
|
plugins = plugins.concat(options.plugins)
|
||||||
}
|
}
|
||||||
|
plugins.forEach(plugin => (typeof plugin === 'function') ? plugin(this) : null)
|
||||||
|
this.extend(options || {})
|
||||||
for (var componentName in this.options.components) {
|
for (var componentName in this.options.components) {
|
||||||
Vue.component(componentName, this.options.components[componentName])
|
Vue.component(componentName, this.options.components[componentName])
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user