Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue 3 support #494

Closed
panuchka opened this issue Oct 6, 2020 · 8 comments
Closed

Vue 3 support #494

panuchka opened this issue Oct 6, 2020 · 8 comments
Labels

Comments

@panuchka
Copy link

panuchka commented Oct 6, 2020

Describe the feature

Vue 3 is now released, and we would like to see the slider updated to support Vue 3!

Describe the solution you'd like

Vue slider component supports Vue 3

@NightCatSama
Copy link
Owner

The next version with vue3 support has been released, but it's still in beta, if you find any bugs you can report back to me!

$ yarn add vue-slider-component@next
# npm install vue-slider-component@next --save

@potatoDie
Copy link

I'm trying the Basic Example. As soon as I start dragging I get the values 'v', 'a', 'l', 'u' and 'e'

@NightCatSama
Copy link
Owner

@potatoDie I forgot to specify, because data had a type conflict in vue3.x (vue-class-component@next), so it was temporarily changed to vData. I should change it back later, but for now, try not to set the data prop.

online example:
https://jsfiddle.net/3ea4qbg9/1/

@potatoDie
Copy link

@NightCatSama Thanks. I got it working too on CodeSandbox, but locally I'm working with Vite and the bug persists.

@NightCatSama
Copy link
Owner

@potatoDie Thanks for the feedback, v4.0.0-beta.2 has been fixed.

@potatoDie
Copy link

Perfect, thanks!

@terax6669
Copy link

terax6669 commented Jan 18, 2021

I'm migrating a project to Vue 3, here's what I've noticed:

  1. When using :v-model the value of the slider was not updated, had to use :modelValue +@change for that. I've noticed that you're using @Prop instead of @Model in
    @Prop({ default: 0 })
    modelValue!: Value | Value[]
  2. During the migration parts of my component weren't working as intended yet. When passing NaN to :min, :max and :value I got a bunch of JS errors about accessing property x of undefined. At first I thought it was some internal error but it turned out to be my fault in the end. There could be a better way of handling it and giving the user a clearer error message.
<vue-slider
	:value="zoom"    <- NaN
	@change="handleZoomChangeThrottled"
	:contained="true"
	direction="btt"
	:dot-size="23"
	:width="9"
	:drag-on-click="true"
	height="200px"
	:interval="0.001"
	:max="maxZoom"    <- NaN
	:min="Math.floor(minZoom * 1000) / 1000"    <- NaN
	tooltipPlacement="right"
	:tooltip-formatter="zoomTooltipFormatter"
/>

@fgarit-te
Copy link

fgarit-te commented Nov 24, 2021

Edit: Will open a separate issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants