Watch for changes on the options input, which is a grandchild of base-form
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import { emitEvent } from '../lib/emitters'
|
||||
import FormMixin from '../mixins/form'
|
||||
|
||||
export default {
|
||||
name: 'optionsinput',
|
||||
|
||||
mixins: [FormMixin],
|
||||
|
||||
props: {
|
||||
name: String,
|
||||
initialErrors: {
|
||||
@@ -10,6 +13,10 @@ export default {
|
||||
default: () => [],
|
||||
},
|
||||
initialValue: String,
|
||||
watch: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
|
||||
data: function() {
|
||||
@@ -27,6 +34,7 @@ export default {
|
||||
emitEvent('field-change', this, {
|
||||
value: e.target.value,
|
||||
name: this.name,
|
||||
watch: this.watch,
|
||||
})
|
||||
this.showError = false
|
||||
this.showValid = true
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import FormMixin from '../mixins/form'
|
||||
import textinput from './text_input'
|
||||
import optionsinput from './options_input'
|
||||
import textinput from './text_input'
|
||||
|
||||
export default {
|
||||
name: 'toggler',
|
||||
|
@@ -16,8 +16,7 @@ export default {
|
||||
const { name, valid, parent_uid } = event
|
||||
if (typeof this[name] !== undefined) {
|
||||
this.fields[name] = valid
|
||||
|
||||
if (parent_uid === this._uid) {
|
||||
if (event['parent_uid'] === this._uid || event['watch']) {
|
||||
this.changed = true
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user