由于 el-slider value 为[value1, value2],所以单个修改是无效的
data(){
return {
startPreValue: 20,
endPreValue: 50,
startAndEndValue: [20, 50]
}
}
无效的做法:
methods: {
startValue(e){
this.startAndEndValue[0] = e
},
endValue(e){
this.startAndEndValue[1] = e
},
}
正确做法:
startValue(e){
this.startAndEndValue = [e, this.endPreValue]
},
endValue(e){
this.startAndEndValue = [this.startPreValue, e]
},
el-slider 数据是一个整体, 不能单独拆分,要完整的更新.