1
0
mirror of synced 2024-11-29 08:36:12 +03:00

Changes the sequence in which plugins are registered

This commit is contained in:
Justin Schroeder 2020-03-07 10:27:51 -05:00
parent f9378cda25
commit 314b2b054e
4 changed files with 9 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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])
} }