This commit is contained in:
梁灏 2017-04-20 11:38:12 +08:00
parent 8dd5468734
commit 62a06f5679
2 changed files with 10 additions and 19 deletions

View file

@ -1,32 +1,19 @@
<template>
<div style="margin: 0 400px;">
<Slider v-model="value1" show-input></Slider>
<Slider v-model="value2" range></Slider>
<Slider v-model="value3" range disabled></Slider>
{{ value1 }}{{value2}}
<div @click="value1 = 13">change value1</div>
<br>
<Slider v-model="value9" :tip-format="format"></Slider>
<Slider v-model="value10" :tip-format="hideFormat"></Slider>
<Slider v-model="value" range></Slider>
<Button @click="change">change</Button>
</div>
</template>
<script>
export default {
data () {
return {
value1: 25,
value2: [20, 50],
value3: [20, 50],
value9: 25,
value10: 25
value: [20, 50]
}
},
methods: {
format (val) {
return '进度' + val + '%';
},
hideFormat () {
return null;
change () {
this.value = [30, 80];
}
}
}

View file

@ -230,7 +230,11 @@
if (value[1] > this.max) {
value[1] = this.max;
}
if (this.value[0] === value[0] && this.value[1] === value[1]) return;
if (this.value[0] === value[0] && this.value[1] === value[1]) {
this.setFirstPosition(this.currentValue[0]);
this.setSecondPosition(this.currentValue[1]);
return;
}
this.currentValue = value;
this.setFirstPosition(this.currentValue[0]);