简体   繁体   English

如何动态设置最大值和最小值<v-slider>在 vue 2.0 中,当我从表中提取最大值和最小值时

[英]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.

相关问题 如何从 jQuery 中的 slider 获取最小值和最大值? - How do I get min and max values from a slider in jQuery? 如何为Kendo Datetimepicker设置最小最大可选时间? - How can I set min max selectable time for Kendo Datetimepicker? 如何为highchart的列设置最小/最大宽度? - How can I set a min/max width to highchart's columns? 如何动态更改jquery ui滑块的最小值,最大值? - How do I dynamically change min,max values for jquery ui slider? 如何获得 Bootstrap 滑块的最小值和最大值? - How do i get Min and Max value of Bootstrap slider? 如何动态设置高图上的最大最小值 - how to set max min on highcharts dynamically 如何为日期选择器设置最小和最大日期? - How do I set a Min and Max date for my datepicker? (Chart.js)如何将最小值(如果可以的话,最大值)设置为特定数字? - (Chart.js) how can I set min value(and max value if I can) as a specific number? 如何区分 slider 范围的值,如何使用它们在屏幕上将最小值和最大值显示为 output? - How can I separate values of range slider and how can I use them for showing min and max value as output on screen? 如何为jQuery UI滑块设置最小/最大间隔和值? - How to set min/max interval and values for jQuery UI slider?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM