
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
swiper-vue2
Advanced tools
npm i swiper-vue2
swiper-vue2
exports SwiperCore
and 2 Vue components: Swiper
, SwiperSlide
<template>
<div>
<swiper
:slides-per-view="3"
:space-between="30"
:loop="false"
@swiper="onSwiper"
@slideChange="onSlideChange"
>
<swiper-slide
v-for="n in 5"
:key="n"
class="test"
:class="{test_2: true}"
>
<div>{{ 29+n }}</div>
<img
:src="getImageUrl(29+n)"
width="600"
height="400"
class="img-fluid w-100 mx-auto"
blank="true"
>
</swiper-slide>
</swiper>
<swiper
:slides-per-view="3"
:space-between="30"
loop
@swiper="onSwiper"
@slideChange="onSlideChange"
>
<swiper-slide
v-for="n in 5"
:key="n"
class="test"
:class="{test_2: true}"
>
<div>{{ 34+n }}</div>
<img
:src="getImageUrl(34+n)"
width="600"
height="400"
class="img-fluid w-100 mx-auto"
blank="true"
>
</swiper-slide>
</swiper>
<h2>pagination - navigation</h2>
<swiper
:slides-per-view="3"
:space-between="30"
:loop="false"
:pagination="true"
:navigation="true"
@swiper="onSwiper"
@slideChange="onSlideChange"
>
<swiper-slide
v-for="n in 5"
:key="n"
class="test"
:class="{test_2: true}"
>
<div>{{ 34+n }}</div>
<img
:src="getImageUrl(34+n)"
width="600"
height="400"
class="img-fluid w-100 mx-auto"
blank="true"
>
</swiper-slide>
</swiper>
</div>
</template>
<script>
import { Navigation, Pagination } from 'swiper'
import { SwiperCore, Swiper, SwiperSlide } from 'swiper-vue2'
// Import Swiper styles
import 'swiper/swiper-bundle.css'
SwiperCore.use([Navigation, Pagination])
export default {
components: {
Swiper,
SwiperSlide
},
methods: {
getImageUrl (imageId) {
return `https://picsum.photos/600/400/?image=${imageId}`
},
onSwiper (swiper) {
console.log(swiper)
},
onSlideChange () {
console.log('slide change')
}
}
}
</script>
<style lang="scss" scoped>
.img-fluid {
max-width: 100%;
height: auto;
}
.w-100 {
width: 100%;
}
.ml-auto, .mx-auto {
margin-left: auto;
}
.mr-auto, .mx-auto {
margin-right: auto;
}
</style>
FAQs
Swiper component for Vue 2
We found that swiper-vue2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.