From cd78c9c488698dcb8c669a3e85d2acca597a373f Mon Sep 17 00:00:00 2001 From: 梁灏 Date: Thu, 9 Mar 2017 11:14:40 +0800 Subject: [PATCH] some comps support dispatch event to FormItem --- src/components/cascader/cascader.vue | 6 ++++-- src/components/checkbox/checkbox-group.vue | 5 +++-- src/components/checkbox/checkbox.vue | 6 ++++-- src/components/date-picker/picker.vue | 8 ++++---- src/components/input-number/input-number.vue | 5 +++-- src/components/input/input.vue | 8 ++++---- src/components/radio/radio-group.vue | 5 +++-- src/components/radio/radio.vue | 6 ++++-- src/components/rate/rate.vue | 3 +-- src/components/select/select.vue | 20 ++++++++------------ src/components/slider/slider.vue | 14 ++++++-------- src/components/switch/switch.vue | 5 +++-- src/components/transfer/transfer.vue | 9 +++++++-- src/components/upload/upload.vue | 5 +++-- 14 files changed, 57 insertions(+), 48 deletions(-) diff --git a/src/components/cascader/cascader.vue b/src/components/cascader/cascader.vue index 9ff66e2..6ee7e9f 100644 --- a/src/components/cascader/cascader.vue +++ b/src/components/cascader/cascader.vue @@ -162,8 +162,10 @@ emitValue (val, oldVal) { if (JSON.stringify(val) !== oldVal) { this.$emit('on-change', this.currentValue, JSON.parse(JSON.stringify(this.selected))); - // todo 事件 -// this.$dispatch('on-form-change', this.currentValue, JSON.parse(JSON.stringify(this.selected))); + this.dispatch('FormItem', 'on-form-change', { + value: this.currentValue, + selected: JSON.parse(JSON.stringify(this.selected)) + }); } } }, diff --git a/src/components/checkbox/checkbox-group.vue b/src/components/checkbox/checkbox-group.vue index e73b25f..69e198a 100644 --- a/src/components/checkbox/checkbox-group.vue +++ b/src/components/checkbox/checkbox-group.vue @@ -4,10 +4,12 @@