Open peppeg85 opened 3 years ago
i tried overwriting the glide classes, for example:
<style scoped>
.glide__bullets {
background-color: #1d1d1d;
height: 40px
}
.glide__bullet {
background-color: red;
height: 20px;
width:20px;
border-radius: 50%;
}
.glide__bullet--active {
background-color: yellow;
}
</style>
but without success
i tried also with the slot control, as you say in the documentation:
<template slot="control">
<div class="flex inline-flex w-full justify-center bg-black">
<button v-for="(el, index) in items" class="h-6 w-6 rounded-full bg-white" :data-glide-dir="'='+index">
</button>
</div>
</template>
but i have this error in the console:
vue-glide.common.js:2209 Uncaught TypeError: Cannot read property 'slice' of null
at Object.resolve (vue-glide.common.js:2209)
at HTMLDivElement.click (vue-glide.common.js:3408)
sorry for all the posts, i solved in this way:
<template slot="control">
<button
v-for="(el, index) in items"
class="h-6 w-6 rounded-full"
:class="active==index?'bg-red-600':'bg-gray-500'"
:data-glide-dir="'='+index" :key="index"
>
</button>
</template>
if it could help someone, but please, update the docs
hello, the items in the v-for are the same of the glide, so the index is the same, here is a sample code
<vue-glide class="" type="slider" :bound="false" :autoplay="2000" :
animation-duration="1000" :gap="10" :per-view="1" :bullet="false" v-model="active"> <vue-glide-slide v-for="(item,index) in items" :key="index" class="block relative py-16 w-full justify-center px-10">
</vue-glide-slide> <template slot="control" class="py-2"> <button v-for="(el, index) in items" class="h-1 w-6 rounded-full
mx-1" :class="active==index?'bg-red':'bg-green'" :data-glide-dir=" '='+index" :key="index">
data() { return { active: 0, items: [ { title: "Lorem ", description: "Lorem Ipsum ",
}, { title: "Lorem ", description: "Lorem Ipsum ", }, { title: "Lorem ", description: "Lorem Ipsum ", }, { title: "Lorem ", description: "Lorem Ipsum ", }, { title: "Lorem ", description: "Lorem Ipsum ", }, ], }
},
Il giorno gio 11 ago 2022 alle ore 09:22 Edoardo Mazzon < @.***> ha scritto:
sorry for all the posts, i solved in this way:
if it could help someone, but please, update the docs
Hi, can I ask you how did you know which slide is active even in bullets? How did you pass the active variable from the slider to the dots?
— Reply to this email directly, view it on GitHub https://github.com/antonreshetov/vue-glide/issues/67#issuecomment-1211636247, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGCCEW6VTZ5HDNPBZHCZSODVYSS4DANCNFSM47BKTLIQ . You are receiving this because you authored the thread.Message ID: @.***>
hello i'm trying to add the bullets to my carousel, but nothing shows, i added :bullet="true" prop and inspecting the html there are the bullets, but nothing shows, any suggestions?
here is the html:
inside the html i have:
and the glide works, i can see the glidebullet glidebullet--active class switch between the bullets, i think is some css issue
the slide section is ok, just the bullets didn't show thanks for your help