NightCatSama/vue-slider-component

How to get the array values on @drag-end

estellederrien opened this issue · 1 comments

Hello,

When the slider has only one value, this works, and refreshes the slider, with the new value got at drag-end:

<vue-slider :value="constraint.value" @change="val => value = +val" @drag-end="constraint.value = value ;"></vue-slider>

but I can't make it work when I am using an array of values :

<vue-slider :value="[constraint.framedMin,constraint.framedMax]" @change="val => value = +val" @drag-end="getValues(value)"></vue-slider>

getValues returns "undefined".
I can't get the new array values , I don't know how to do.

Do you have any idea how I should do to update/refresh the vue-slider when using an array as value?
I have tried things like val[0] and value[0] and value[1] with no luck.

Thanks a lot, have a nice day !

It is better to use v-model, you can also get the latest value by $refs.sliders.getValue().