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

View file

@ -230,7 +230,11 @@
if (value[1] > this.max) { if (value[1] > this.max) {
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.currentValue = value;
this.setFirstPosition(this.currentValue[0]); this.setFirstPosition(this.currentValue[0]);