vue-carousel icon indicating copy to clipboard operation
vue-carousel copied to clipboard

Custom Navigation Buttons

Open rishabhgoel9797 opened this issue 5 years ago • 6 comments

i am not able to use navigation-prev-label='<img src="~/assets/images/banner-left.svg">'

rishabhgoel9797 avatar Apr 16 '19 08:04 rishabhgoel9797

Try something like this?

navigation-next-label=""
navigation-prev-label=""
.VueCarousel-navigation-next::after {
  content: url('/images/banner-right.svg');
}
.VueCarousel-navigation-prev::after {
  content: url('/images/banner-left.svg');
}

digi-com avatar Apr 17 '19 00:04 digi-com

@digi-com Is that possible to make my own custom button? Something like that: Screen_Shot_2019-04-23_at_12_58_21_PM

phuclh avatar Apr 23 '19 19:04 phuclh

In template,

<carousel
    :navigation-enabled="true"
    :navigation-next-label="nextLabel"
    :navigation-prev-label="prevLabel"
>
</carousel>

In script,

data () {
    return {
        nextLabel: "<img src='/assets/images/chevron-right.png' />",
        prevLabel: "<img src='/assets/images/chevron-left.png' />"
    }
}

xiashaxs avatar Sep 16 '19 10:09 xiashaxs

Thanks so much @shasarah !!!

nabilfreeman avatar Aug 01 '20 10:08 nabilfreeman

@shasarah this sounds like an answew, but gives me " Property or method "nextLabel" is not defined on the instance but referenced during render" when having this in .vue file:

<template>
  <div>
    <slot/>
  </div>
</template>
<script>

import Vue from 'vue';
import Carousel from 'vue-carousel';
Vue.use(Carousel);
import Slide from 'vue-carousel';
Vue.use(Slide);


export default {
  components: {
    'carousel': Carousel,
    'slide': Slide
  },
  methods: {
  },
  props: {
  },
  data() {
    return {
    nextLabel: "<i class='ico--chevron-right'></i>",
    prevLabel: "<i class='ico--chevron-left'></i>"
	  }
  }
}

</script>

and this in html file:

<carousel :per-page=1 :navigation-enabled="true" :navigation-prev-label="prevLabel"  :navigation-next-label="nextLabel" class="article-card-list pt-12 pb-8">
              <slide>lorem</slide>
              <slide>ipsum</slide>
</carousel>

Thanks so much anyone who knows!

panfanky avatar May 03 '21 10:05 panfanky

try to use computed instead of data

GileadGaf avatar Jul 16 '21 16:07 GileadGaf