c语言中swipe的作用,C-Swipe Mobile 一个适用于Vue2.x的移动端轮播组件

近期在做的一个Vue2项目里需要一个可以滑动的轮播组件,但是又因为现有的传统轮播库功能过于繁琐和笨重。因此自己写了一个针对于Vue2.x的轻型轮播组件。

项目GitHub链接:C-Swipe Mobile 无耻的求个star

目前仅支持移动端。

组件通过v-model绑定了组件当前分页索引值,这很大的方便了组件的使用者。

其实想想目前这个组件也不能叫轮播组件,因为目前是不支持自动轮播的,只支持手动左右滑动切换分页,不过后期考虑加入自动轮播等功能。

以下是组件的文档:

C-Swipe Mobile

A swipe (touch slide) component for Vue2.x in mobile device.

Only support touch event now.

Usage

register components:

// main.js

// import Vue files into main.js

import Swipe from './components/vue-swipe.vue';

import SwipeItem from './components/vue-swipe.vue';

// register components

Vue.component('swipe', Swipe);

Vue.component('swipe-item', SwipeItem);

Work on a Vue instance:

item1

item2

item3

new Vue({

// ...

// ...

// ...

data: function () {

return {

index: 0, // two way

};

},

});

Options

Option

Description

v-model

Number. The value binding index of swipe-item, binding two way.

pagination

Boolean. If need default pagination. If you want to customize pagination, the value of v-model will help you make sure which item is showing.

License

MIT

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值