Merge pull request #4536 from weidapao/fix_bug

fix(InputNumber): 解决组件InputNumber无法blur时校验的问题
This commit is contained in:
Aresn 2018-09-18 09:22:43 +08:00 committed by GitHub
commit 0941fdc0be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,7 +34,7 @@
</div>
</template>
<script>
import { oneOf } from '../../utils/assist';
import { oneOf, findComponentUpward } from '../../utils/assist';
import Emitter from '../../mixins/emitter';
const prefixCls = 'ivu-input-number';
@ -278,6 +278,9 @@
blur () {
this.focused = false;
this.$emit('on-blur');
if (!findComponentUpward(this, ['DatePicker', 'TimePicker', 'Cascader', 'Search'])) {
this.dispatch('FormItem', 'on-form-blur', this.currentValue);
}
},
keyDown (e) {
if (e.keyCode === 38) {