更新记录

1.0.0(2025-06-21) 下载此版本

  • 通用手势滑动容器
  • 兼容app和微信小程序
  • 实际使用可全局注册

平台兼容性

uni-app

Vue2 Vue3 Chrome Safari app-vue app-nvue Android iOS 鸿蒙
× - - - - - -
微信小程序 支付宝小程序 抖音小程序 百度小程序 快手小程序 京东小程序 鸿蒙元服务 QQ小程序 飞书小程序 快应用-华为 快应用-联盟
- - - - - - - - - - -

使用

test.vue
<template>
    <view class="">
        <WangXx-slideByTouch @touchs="touchs">
            <view class="box">
                滑动方向:{{txt}}
            </view>
        </WangXx-slideByTouch>
    </view>
</template>

<script setup >
    import { ref } from 'vue';
    const txt = ref('')
    const touchs = ({left,right,direction})=>{
        txt.value = {1:'左滑',2:'右滑'}[direction]
    }
</script>

<style lang="scss" scoped>
.box{
    height: 100vh;
    width: 100vw;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: #76bcb4;
}
</style>

参数说明

属性名 类型 默认值 描述
threshold Number 50 滑动阈值,即判断距离

事件

事件名 类型 回调参数 描述
touchs funtion {left,right,direction} 左滑:left为true 右滑:right:为true,direction:1:'左滑',2:'右滑'

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

暂无用户评论。

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问