mirror of https://github.com/ElemeFE/element
Slider: triggers validator when value changed, fixed #3968
parent
d0be75a467
commit
48054d12a5
|
@ -46,10 +46,13 @@
|
||||||
import ElInputNumber from 'element-ui/packages/input-number';
|
import ElInputNumber from 'element-ui/packages/input-number';
|
||||||
import SliderButton from './button.vue';
|
import SliderButton from './button.vue';
|
||||||
import { getStyle } from 'element-ui/src/utils/dom';
|
import { getStyle } from 'element-ui/src/utils/dom';
|
||||||
|
import Emitter from 'element-ui/src/mixins/emitter';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ElSlider',
|
name: 'ElSlider',
|
||||||
|
|
||||||
|
mixins: [Emitter],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
min: {
|
min: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
@ -173,6 +176,7 @@
|
||||||
this.secondValue = val[1];
|
this.secondValue = val[1];
|
||||||
if (this.valueChanged()) {
|
if (this.valueChanged()) {
|
||||||
this.$emit('change', [this.minValue, this.maxValue]);
|
this.$emit('change', [this.minValue, this.maxValue]);
|
||||||
|
this.dispatch('ElFormItem', 'el.form.change', [this.minValue, this.maxValue]);
|
||||||
this.oldValue = val.slice();
|
this.oldValue = val.slice();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -185,6 +189,7 @@
|
||||||
this.firstValue = val;
|
this.firstValue = val;
|
||||||
if (this.valueChanged()) {
|
if (this.valueChanged()) {
|
||||||
this.$emit('change', val);
|
this.$emit('change', val);
|
||||||
|
this.dispatch('ElFormItem', 'el.form.change', val);
|
||||||
this.oldValue = val;
|
this.oldValue = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue