[英]How can I set max and min dynamically in <v-slider> in vue 2.0 when i am extracting max and min from a table
Code:Also help me how can i take steps of 5 here代码:还请帮助我如何在此处执行 5 步
<v-slider v-model="list1" :min="1" :max="1000">
</v-slider>
data () {
return {"list1": [0,1] //list 1 will have all the range of data selected.
}
}
created()
{
//method call to extract the table data where i calculate max and min in table too
}
<v-slider v-model="list1" :min="minValue" :max="maxValue">
</v-slider>
data () {
return {
list1: [0,1], //list 1 will have all the range of data selected.
minValue: 1,
maxValue: 1000
}
}
created()
{
//method call to extract the table data where i calculate max and min in table too
this.minValue = <calculated minimum value>
this.maxValue = <calculated maximum value>
}
When dynamically
setting the max
, you should ensure that the number of decimal places in the max matches the interval
. dynamically
设置max
,应确保最大值中的小数位数与interval
匹配。 For example:例如:
{min: 0, max: 100.5, interval: 0.1}
or
{min: 0, max: 100.55, interval: 0.01}
This way, it's possible to get to the max
from the min
using the interval.这样,就可以使用间隔从
min
达到max
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.