Fixes a reactivity issue with initial props
This commit is contained in:
parent
4655e2a31f
commit
797a52bb5a
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -71,6 +71,11 @@ export default {
|
||||
return this.behavior === 'live'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
initial () {
|
||||
this.hydrate(this.initial)
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.hydrate(this.initial)
|
||||
},
|
||||
@ -83,7 +88,7 @@ export default {
|
||||
this.updateFormValidation()
|
||||
},
|
||||
hydrate (values) {
|
||||
for (let field in this.fields) {
|
||||
for (let field of this.fields) {
|
||||
if (field.type !== 'submit') {
|
||||
this.$store.commit(`${this.m}setFieldValue`, {
|
||||
field: field.name,
|
||||
@ -135,6 +140,6 @@ export default {
|
||||
this.$emit('submit', Object.assign({}, this.values))
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
@ -279,6 +279,9 @@ export default {
|
||||
errors: this.localAndValidationErrors
|
||||
})
|
||||
}
|
||||
},
|
||||
initial () {
|
||||
this.form.update({field: this.name, value: this.initial})
|
||||
}
|
||||
},
|
||||
created () {
|
||||
|
Loading…
Reference in New Issue
Block a user