diff --git a/examples/routers/auto-complete.vue b/examples/routers/auto-complete.vue index 17d983c..2220824 100644 --- a/examples/routers/auto-complete.vue +++ b/examples/routers/auto-complete.vue @@ -30,7 +30,7 @@ ] }, hc (v) { - console.log(v) +// console.log(v) }, fm (value, item) { return item.toUpperCase().indexOf(value.toUpperCase()) !== -1; diff --git a/examples/routers/form.vue b/examples/routers/form.vue index 810bcda..f19959a 100644 --- a/examples/routers/form.vue +++ b/examples/routers/form.vue @@ -2,7 +2,7 @@
- + @@ -56,6 +56,7 @@ export default { data () { return { + name: '', formValidate: { name: '', mail: '', @@ -68,7 +69,7 @@ }, ruleValidate: { name: [ - { required: true, message: '姓名不能为空', trigger: 'blur' } + { required: true, message: '姓名不能为空', trigger: 'change' } ], mail: [ { required: true, message: '邮箱不能为空', trigger: 'blur' }, diff --git a/src/components/auto-complete/auto-complete.vue b/src/components/auto-complete/auto-complete.vue index 6dd9b3c..c90a709 100644 --- a/src/components/auto-complete/auto-complete.vue +++ b/src/components/auto-complete/auto-complete.vue @@ -36,9 +36,11 @@ import iOption from '../select/option.vue'; import iInput from '../input/input.vue'; import { oneOf } from '../../utils/assist'; + import Emitter from '../../mixins/emitter'; export default { name: 'AutoComplete', + mixins: [ Emitter ], components: { iSelect, iOption, iInput }, props: { value: { @@ -103,6 +105,7 @@ this.$refs.select.query = val; this.$emit('input', val); this.$emit('on-change', val); + this.dispatch('FormItem', 'on-form-change', val); } }, methods: { diff --git a/src/components/select/select.vue b/src/components/select/select.vue index 90914f9..525e758 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -685,6 +685,7 @@ this.$on('on-select-selected', (value) => { if (this.model === value) { + if (this.autoComplete) this.$emit('on-change', value); this.hideMenu(); } else { if (this.multiple) { -- libgit2 0.21.4