soundar24 / vue-round-slider

A round slider component for Vue JS, with range slider support. Also it can be any kind of arc slider such as pie shape, half / semi-circle, quarter circle shape sliders.
https://vue.roundsliderui.com/
MIT License
69 stars 14 forks source link

TooltipFormat With Array v-model #4

Open recep-yildiz opened 4 years ago

recep-yildiz commented 4 years ago

As i saw, tooltip can't be formatted with array values.

I have an array like "arr[0, 24]" (v-model="arr")

i need to format it like "0 am - 12 pm", couldn't achieve this

by the way, in events, options.value should be an object, not a string

soundar24 commented 4 years ago

@ItStark the model supports any kind of type such as number | sting | array. Currently the array type was not defined in the props, so that it might throw the warring when set array value. That I will correct and push a new version.

And through the tooltipFormat you can achieve any custom value, here I have updated a simple demo:

https://codesandbox.io/s/dazzling-bouman-eg8dm?file=/src/components/SliderDemo.vue

Is this the expected one?

Also regarding the options.value type, commonly we maintained the string type only for the value prop. Even what kind of type you passed, it will maintain the string type only. If still you want the value as array then you can get it through a computed property. Can you give more info about your requirement, so that I can suggest a better solution or if needed ll integrate with the source. Thanks...

recep-yildiz commented 4 years ago

I will achieve just like you said, gonna use computed property for that.

The link you shared is just like i would like to do. Thanks so much.