mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-12-02 12:18:46 +08:00
Slider: warn against min being greater than max (#9997)
This commit is contained in:
parent
12b6a10f70
commit
067a9be7d1
@ -193,6 +193,10 @@
|
||||
}
|
||||
},
|
||||
setValues() {
|
||||
if (this.min > this.max) {
|
||||
console.error('[Element Error][Slider]min should not be greater than max.');
|
||||
return;
|
||||
}
|
||||
const val = this.value;
|
||||
if (this.range && Array.isArray(val)) {
|
||||
if (val[1] < this.min) {
|
||||
@ -269,7 +273,7 @@
|
||||
|
||||
computed: {
|
||||
stops() {
|
||||
if (!this.showStops) return [];
|
||||
if (!this.showStops || this.min > this.max) return [];
|
||||
if (this.step === 0) {
|
||||
process.env.NODE_ENV !== 'production' &&
|
||||
console.warn('[Element Warn][Slider]step should not be 0.');
|
||||
|
Loading…
Reference in New Issue
Block a user