Closed jamols09 closed 2 years ago
Seem to be only for vue 2 due to how h
function is used: https://github.com/mpbarlow/vue-renderless-carousel/blob/master/src/RlCarouselSlide.vue#L4
+1 for this question. It doesn't mention Vue version anywhere, and it doesn't work properly with Vue 3.
It’s only been tested with Vue ^2.6 so it probably doesn’t work with Vue 3.
Does anyone know how much work is involved in adding Vue 3 support? I don’t do front-end in my day job anymore so I’m behind the times.
It’s only been tested with Vue ^2.6 so it probably doesn’t work with Vue 3.
Does anyone know how much work is involved in adding Vue 3 support? I don’t do front-end in my day job anymore so I’m behind the times.
Yeah it seems so. I'm honestly stuck in a project myself because i cannot seem to find any useful Vue 3 carousel what so ever, and i've spent 2 days so far :(
In this Jan 2021 comment, the author wrote that an update that ensured Vue 2 and 3 compatibility was going to be released soon, then there was a commit (the most recent) on April 28, 2021 (v 1.31). Still, there is nothing explicitly stating Vue 3 support.
Matt, (@mpbarlow) would you please clarify whether or not the current version is Vue-3 compatible? Thank you!
Hi @mgav. I've spent a bit of time investigating bringing this to Vue 3 today, and from what I can tell it would require a decent amount of rework to pull off unfortunately.
Things like use of h()
and this.$scopedSlots
are easy to fix, however the removal of this.$children
is something of a blocker. This allowed me to easily grab the number and sizes of slides from the parent carousel component without needing to worry about any intermediate wrapping elements. The suggested replacement is to use ref
s to get direct access to the elements, however as they are user-provided via slots, this is obviously a non-starter.
Assuming you still can't emit events through slot boundaries in Vue 3, it would probably need some sort of function prop approach, but ultimately it's more work than I am willing or able to commit to, sorry.
Thank you @mpbarlow for your quick and clear response, as well as all your good work up until now. Gratefully, -M
What Vue version does it work?