Suggest adding autoplayOn binary prop #143
midnightdm
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The Carousel tag currently has an autoplay prop for a millisecond number value.
Setting autoplay to 0 didn't shut it off as expected. My work around was to set it to 500000 making seem like slides are off when really they are just slow. I propose the programmers add a new prop of "autoplayOn" with a boolean value while keeping the "autoplay" prop numeric to set the delay. This would allow the auto play feature to be engaged and disengaged by changing the autoplayOn value dynamically.
Another work around I could have done was to have 2 separate Carousel tags with different option props set and activated by v-if...
<Carousel v-if="store.state.a.autoplayOn"
v-model="currentSlide"
:items-to-show="1"
:wrap-around="true"
:autoplay="store.state.a.liveAutoDelay*1000"
>
<slide>...</slide>
</Carousel>
<Carousel v-if="!store.state.a.autoplayOn"
v-model="currentSlide"
:items-to-show="1"
:wrap-around="true"
>
<slide>...</slide>
</Carousel>
I didn't like this solution as I would have needed to duplicate my lengthy <slide> code for each condition.
Beta Was this translation helpful? Give feedback.
All reactions