[Vuejs]-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

-1πŸ‘

<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>
    }
πŸ‘€Anatoly

-1πŸ‘

When dynamically setting the max, you should ensure that the number of decimal places in the max matches the 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.

Leave a comment