vuetify v-slider Anyway to get the new value after changing the position?

2.6k Views Asked by At

my v-slider is binded with the value of an audio progress() function

      <v-slider id="progress" @click.native="setPosition()" color="#464898" :value="trackProgress"></v-slider>

when the user move the slider , I need to get the new position but as I did not set a v-model I cannot get it ... If a set a v-model="percentage", then I can get the position BUT I'll lost the :value property link...

computed: {
   trackProgress() {
     return this.progress * 100;
   },

  methods: {
    setPosition() {
      const currentDuration = parseInt(this.duration * this.percentage);
      this.setSeek(currentDuration);
      this.play();
    }
  },

I m looking for a one-way data binding , slider => value on each progress so when I click on the slider I get the clicked position ....

1

There are 1 best solutions below

1
antoniopol06 On

You can check start, end and change events. These events happen when user drag and drop the value.

Other way to check the value is adding a watcher to value, you can access de old and new value into watcher functions.

I hope that It works.