Commit 48054d12 authored by pengchongfu's avatar pengchongfu Committed by 杨奕

Slider: triggers validator when value changed, fixed #3968

parent d0be75a4
......@@ -46,10 +46,13 @@
import ElInputNumber from 'element-ui/packages/input-number';
import SliderButton from './button.vue';
import { getStyle } from 'element-ui/src/utils/dom';
import Emitter from 'element-ui/src/mixins/emitter';
export default {
name: 'ElSlider',
mixins: [Emitter],
props: {
min: {
type: Number,
......@@ -173,6 +176,7 @@
this.secondValue = val[1];
if (this.valueChanged()) {
this.$emit('change', [this.minValue, this.maxValue]);
this.dispatch('ElFormItem', 'el.form.change', [this.minValue, this.maxValue]);
this.oldValue = val.slice();
}
}
......@@ -185,6 +189,7 @@
this.firstValue = val;
if (this.valueChanged()) {
this.$emit('change', val);
this.dispatch('ElFormItem', 'el.form.change', val);
this.oldValue = val;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment