SSENSE / vue-carousel

A flexible, responsive, touch-friendly carousel for Vue.js
https://ssense.github.io/vue-carousel/
MIT License
1.72k stars 504 forks source link

when i click on pagination - automatically page reload (prevent page reloading issue) #602

Open ajaypseudocode opened 2 years ago

ajaypseudocode commented 2 years ago

<carousel :per-page="1" :navigationEnabled="true" :mouse-drag="false" :paginationPadding="3" indicators="hover" :navigationNextLabel="<i class='fas fa-angle-right side-icon-size'></i>" :navigationPrevLabel="<i class='fas fa-angle-left side-icon-size'></i>" :navigationClickTargetSize="8" :paginationActiveColor="Settings.primaryColor? Settings.primaryColor: '#676767'" :paginationColor="Settings.primaryColor? Settings.primaryColor: '#676767'" :autoplay=true :autoplayTimeout="Settings.sliderTime" :loop="true" :mouseDrag="true" :speed="Settings.sliderSpeed">

    </carousel>
N-coder-bot commented 2 years ago

Hey! I am a newbie and I would like to solve this issue. Can you please help in setting up this project on my local machine?

gabriel0689 commented 1 year ago

Having this issue as well. When clicking the pagination dots the page reloads.

ajaypseudocode commented 1 year ago

Hi gabriel I am ajay, i also face the same issue , i handled this issue by added this code snippet on mounted please add this code and check it , i think this will solve your problem let clearIntervalTime= setInterval(()=>{ if(document.getElementsByClassName('VueCarousel-dot')){ let ele=document.getElementsByClassName('VueCarousel-dot') ele.forEach(event=>{ event.addEventListener("click", function(event){ event.preventDefault() }); }) clearInterval(clearIntervalTime) } },500)

Having this issue as well. When clicking the pagination dots the page reloads.