question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Navigation buttons not working

See original GitHub issue

Vue.js version and component version

Latest from NPM (4.1.1)

Reproduction Link

I can’t reproduce it when starting with the suggested fiddle link, which means it’s clearly on my end, but I could use some help

This is my configuration:

<template>
<swiper class="swiper" ref="slideSwiper" 
                        :options="swiperOptions"
                        :auto-destroy="true"
                        :delete-instance-on-destroy="true"
                        :cleanup-styles-on-destroy="true">
                    <swiper-slide class="carousel-slide" v-for="(slide, i) in sliderSlides"
                                  :key="'slide ' + i">
                        <img :src="$utils.getThumbnailUrl('xs', slide, false, true)" />
                    </swiper-slide>
                    <div class="swiper-button-next" slot="button-next"></div>
                    <div class="swiper-button-prev" slot="button-prev"></div>
</swiper>
</template>
import { Swiper, SwiperSlide } from 'vue-awesome-swiper';
import 'swiper/swiper-bundle.css';

export default {
    components: {
        Swiper,
        SwiperSlide
    },

    data() {
        return {
            swiperOptions: {
                    //loop: true,
                    //loopedSlides: 5, // looped slides should be the same
                    spaceBetween: 30,
                    centeredSlides: true,
                    slidesOffsetBefore: '100px',
                    slidesOffsetAfter: '100px',
                    slidesPerView: 'auto',
                    touchRatio: 0.2,
                    slideToClickedSlide: true,
                    navigation: {
                        nextEl: '.swiper-button-next',
                        prevEl: '.swiper-button-prev'
                    }
                }
        }
    }
}

The next/previous buttons show up properly, but have no click event bound to them for some reason. What am I doing wrong?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:22
  • Comments:41

github_iconTop GitHub Comments

113reactions
sergey-seleznevcommented, Jul 9, 2020

Same problem here. This package currently works fine with Swiper v5 (i.e. yarn add swiper@5.4.5 and import "swiper/css/swiper.css"). Swiper v6.0.0 and v6.0.1 seems to be not compatible so far with the broken navigation (at least).

86reactions
jalalianmohsen89commented, Jul 28, 2020

I solved the problem this way Define swiper globally with this code

import Vue from ‘vue’ import {Swiper as SwiperClass, Pagination, Navigation, Mousewheel, Autoplay} from ‘swiper/swiper.esm’ import getAwesomeSwiper from ‘vue-awesome-swiper/dist/exporter’

SwiperClass.use([Pagination, Mousewheel, Navigation, Autoplay]) Vue.use(getAwesomeSwiper(SwiperClass)) const {Swiper, SwiperSlide} = getAwesomeSwiper(SwiperClass)

// import style import ‘swiper/swiper-bundle.min.css’

Read more comments on GitHub >

github_iconTop Results From Across the Web

What To Do If Android Home And Back Button Are Not Working
Fixes: Android Home and Back Button Not Working · 1. Use Third-Party Apps · 2. Force Restart the Device · 3. Wipe Cache...
Read more >
Back button not working on Android? Try these 5 fixes!
If the back button is missing or not working on Android, check Navigation settings, wipe cache partition, or perform a factory reset.
Read more >
How to fix Back Button/Home Button Not Working on Android ...
Android Back Button/Home Button Not Working [Fixed] · Restart your Device · Use a third-party menu(navigation) button App · Wipe Cache Partition ·...
Read more >
9 Ways to Fix Home Button Not Working on Android - iMobie
Way 1. Restart Your Device ... One of the reasons your Home button is not working is that there is a minor bug...
Read more >
5 Ways to fix the home button not working on Android - Carlcare
Step 1: Switch off the phone, and long-press the power button + Volume (down) button ; Step 2: Select 'Recovery' mode ; Step...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found