DesignRevision / shards-vue

🌟Shards Vue is a free, beautiful and modern Vue.js UI kit based on Shards.
https://designrevision.com/docs/shards-vue/
MIT License
393 stars 40 forks source link

Slider converts Number values into String #8

Closed iamDecode closed 5 years ago

iamDecode commented 5 years ago

Expected Behavior

When you use a <d-slider :v-model="test"> component to alter a data() variable test, test takes on the value of the slider of type Number.

Current Behavior

Even if variable test is a Number before, after slider updates will convert it into a String.

Steps to Reproduce

Just bind d-slider to any variable, bug is very consistent.

Context (Environment)

I am using d-slider components to test if my system is updating correctly (during development). Currently I have to parseFloat all my variables that I want to change, which is fairly tedious.

Possible Solution / Possible Implementation

Use parseFloat on the value that is emitted perhaps?

hisk commented 5 years ago

@iamDecode Thanks for submitting this! 😁I think this is caused by how thenoUiSlider.get() method works and returns a string for the value as far as I know (the method is used internally to get the slider's value). I'll check it out in more depth and get back to you soon.

hisk commented 5 years ago

I apologize for the delay. I'm afraid this won't go into Shards Vue since it's specific to how noUiSlider works by default.