c语言中swipe的作用,Vue.js的滑动(触摸滑块)组件 - vue-swipe-mobile

Vue.js应用程序的最小移动优先滑动器(触摸滑块)组件。

安装和下载:

# NPM

$ npm install c-swipe --save

使用

注册组件

// main.js

// 引入 c-swipe 主文件

import 'c-swipe/dist/swipe.css';

import { Swipe, SwipeItem } from 'c-swipe';

// 全局注册组件

Vue.component('swipe', Swipe);

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

在 .vue 单文件组件中使用:

v-model="index"

style="text-align: center; line-height: 80px; height: 100px; background: #42b983;"

>

item1

item2

item3

new Vue({

data: function () {

return {

index: 0, // two way

};

},

});

或者,你想在 html 标签中直接引用

var vueSwipe = swipe.Swipe;

var vueSwipeItem = swipe.SwipeItem;

new Vue({

el: 'body',

// 注册组件

components: {

'swipe': vueSwipe,

'swipe-item': vueSwipeItem

},

// ...

// ...

});

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值