antonreshetov / vue-glide

A slider and carousel as vue component on top of the Glide.js
https://antonreshetov.github.io/vue-glide/
MIT License
269 stars 39 forks source link

Next/Previous Arrow Control #45

Open tylerwiegand opened 4 years ago

tylerwiegand commented 4 years ago

JUST IN CASE anyone is about to spent too much time looking (like I did) for support for the previous and next arrows, look no further than the Workbench.vue file in the vue-glide-js folder. Inside your vue-glide component just paste that bad boy in there and you got your buttons.

<vue-glide>
   <vue-glide-slide>
      content here
   </vue-glide-slide>
   <template slot="control">
      <button data-glide-dir="<">prev</button>
      <button data-glide-dir=">">next</button>
   </template>
</vue-glide
tyler-morales commented 4 years ago

@tylerwiegand How can you both of the buttons as a whole? I've tried wrapping the two buttons inside one div and use a class on that, but then the button functionally breaks down. Essentially, what I'm trying to accomplish is centering the buttons in the middle of my slider. Currently they are up against the left edge of the glide container.

josegus commented 4 years ago

@tylerwiegand How can you both of the buttons as a whole? I've tried wrapping the two buttons inside one div and use a class on that, but then the button functionally breaks down. Essentially, what I'm trying to accomplish is centering the buttons in the middle of my slider. Currently they are up against the left edge of the glide container.

I did it: image

Don't forget to use default css, so the slider wont break '~vue-glide-js/dist/vue-glide.css';

tyler-morales commented 4 years ago

@josegus I tried what you did, but the buttons aren't functional. Have you checked their functionality?

Screen Shot 2020-09-15 at 11 34 08 PM

josegus commented 4 years ago

@josegus I tried what you did, but the buttons aren't functional. Have you checked their functionality?

Screen Shot 2020-09-15 at 11 34 08 PM

yes, I tried, it worked for me.

I'm just wrapping the control slot with a custom div, it should be enough to make it customizable

antonreshetov commented 3 years ago

@tylerwiegand https://antonreshetov.github.io/vue-glide/slots/#control