diff --git a/examples/routers/form.vue b/examples/routers/form.vue index f19959a..7715e03 100644 --- a/examples/routers/form.vue +++ b/examples/routers/form.vue @@ -5,7 +5,8 @@ - + + @@ -72,8 +73,7 @@ { required: true, message: '姓名不能为空', trigger: 'change' } ], mail: [ - { required: true, message: '邮箱不能为空', trigger: 'blur' }, - { type: 'email', message: '邮箱格式不正确', trigger: 'blur' } + { required: true, message: '邮箱不能为空', trigger: 'change' } ], city: [ { required: true, message: '请选择城市', trigger: 'change' } diff --git a/src/components/color-picker/color-picker.vue b/src/components/color-picker/color-picker.vue index 47f69f6..26ab49e 100644 --- a/src/components/color-picker/color-picker.vue +++ b/src/components/color-picker/color-picker.vue @@ -66,6 +66,7 @@ import Alpha from './alpha.vue'; import { oneOf } from '../../utils/assist'; + import Emitter from '../../mixins/emitter'; const prefixCls = 'ivu-color-picker'; const inputPrefixCls = 'ivu-input'; @@ -121,6 +122,7 @@ export default { name: 'ColorPicker', + mixins: [ Emitter ], components: { Drop, Confirm, RecommendColors, Saturation, Hue, Alpha }, directives: { clickoutside, TransferDom }, props: { @@ -344,11 +346,13 @@ const color = this.formatColor; this.$emit('input', color); this.$emit('on-change', color); + this.dispatch('FormItem', 'on-form-change', color); this.handleClose(); }, handleClear () { this.$emit('input', ''); this.$emit('on-change', ''); + this.dispatch('FormItem', 'on-form-change', ''); this.handleClose(); }, handleSelectColor (color) { -- libgit2 0.21.4