Pagination is not working on Swiper6
See original GitHub issueVue.js version and component version
- vue@2.6.11
- swiper@6.0.2
- vue-awesome-swiper@4.1.1
※ These from yarn of version is 1.22.4
Reproduction Link
I can’t worked sample code of pagination.
This is my code:
<template>
<div class="posts">
<div class="post" v-for="(user, key) in userList" :key="key">
...
<div class="post__image">
<swiper :options="swiperOptions" ref="mySwiper">
<swiper-slide v-for="(content_image, key) in user.content_images" :key="key">
<img :src="content_image.image.url" />
</swiper-slide>
<div class="swiper-pagination" slot="pagination" />
</swiper>
</div>
...
</div>
</div>
</template>
<script lang="ts">
import Vue from "vue";
import { Swiper, SwiperSlide, directive } from "vue-awesome-swiper";
export default Vue.extend({
components: {
Swiper,
SwiperSlide,
},
directives: {
swiper: directive,
},
props: {
userList: {
type: Array,
required: true,
},
},
data: function () {
return {
swiperOptions: {
loop: false,
slidesPerView: 1,
centeredSlides: true,
pagination: {
el: ".swiper-pagination",
type: "bullets",
clickable: true,
},
},
};
},
});
</script>
What am I doing wrong? please teach me.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:32
- Comments:22
Top Results From Across the Web
Swiper pagination not showing - Stack Overflow
Post is old, but still don't have correct answer, so: You need to import modules. // core version + navigation, pagination modules: import ......
Read more >Swiper.js (pagination not working) - Forum | Webflow
Hello, I'm trying to implement swiper.js and I can't make the pagination to work. I tried the progress bar pagination and the bullet...
Read more >Getting Started With Swiper
If you are upgrading from Swiper 6 to Swiper 7, check out Migration Guide to Swiper 7 ... core version + navigation, pagination...
Read more >Swiper API
Not intended to be used with loop or pagination ... Enable to release Swiper events for swipe-back work in app. If set to...
Read more >ember-swiper6 - npm Package Health Analysis - Snyk
Learn more about ember-swiper6: package health score, popularity, security, maintenance, versions and more. ... No known security issues.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes. I have a Project running with swiper 5.3.7 where the pagination works fine. (vue-awesome-swiper version there is 4.1.0)
Don’t use
vue-awesome-swiper
, its broken and the repo is not maintained. Use the official swiper, it supports Vue 3 officialy: https://swiperjs.com/vue But you can also use the core of it with Vue 2. Here is an example:tamplate part:
script part: