
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
vue-swipe is a touch slider for Vue.js.
$ npm install vue-swipe
Import components to your project:
require('vue-swipe/dist/vue-swipe.css');
// in ES6 modules
import { Swipe, SwipeItem } from 'vue-swipe';
// in CommonJS
const { Swipe, SwipeItem } = require('vue-swipe');
// in Global variable
const { Swipe, SwipeItem } = VueSwipe;
And register components:
Vue.component('swipe', Swipe);
Vue.component('swipe-item', SwipeItem);
<link rel="stylesheet" href="../node-modules/vue-swipe/dist/vue-swipe.css" charset="utf-8">
<script src="../node-modules/vue-swipe/dist/vue-swipe.js"></script>
const vueSwipe = VueSwipe.Swipe;
const vueSwipeItem = VueSwipe.SwipeItem;
new Vue({
el: 'body',
components: {
'swipe': vueSwipe,
'swipe-item': vueSwipeItem
}
});
Work on a Vue instance:
<swipe class="my-swipe">
<swipe-item class="slide1"></swipe-item>
<swipe-item class="slide2"></swipe-item>
<swipe-item class="slide3"></swipe-item>
</swipe>
.my-swipe {
height: 200px;
color: #fff;
font-size: 30px;
text-align: center;
}
.slide1 {
background-color: #0089dc;
color: #fff;
}
.slide2 {
background-color: #ffd705;
color: #000;
}
.slide3 {
background-color: #ff2d4b;
color: #fff;
}
Option | Type | Description | Default |
---|---|---|---|
speed | Number | Speed of animation | 300 |
defaultIndex | Number | Start swipe item index | 0 |
disabled | Boolean | Disable user drag swipe item | false |
auto | Number | Delay of auto slide | 3000 |
continuous | Boolean | Create an infinite slider without endpoints | true |
showIndicators | Boolean | Show indicators on slider bottom | true |
noDragWhenSingle | Boolean | Do not drag when there is only one swipe-item | true |
prevent | Boolean | preventDefault when touch start, useful for some lower version Android Browser (4.2, etc) | false |
propagation | Boolean | solve nesting | false |
disabled | Boolean | disabled user swipe item | false |
Event Name | Description | params |
---|---|---|
change | triggers when current swipe-item change | new swipe item Index, old swipe item Index |
Use ref and call goto()
method.
this.$refs.swipe.goto(newIndex)
For more details, please refer to example code.
Watching with hot-reload:
$ npm run dev
Develop on real remote device:
$ npm run remote-dev {{ YOUR IP ADDRESS }}
MIT
FAQs
A touch slider for vue.js.
The npm package vue-swipe receives a total of 354 weekly downloads. As such, vue-swipe popularity was classified as not popular.
We found that vue-swipe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.