更新记录

1.0.0(2023-11-22)

组件初始化


平台兼容性

Vue2 Vue3
App 快应用 微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序
HBuilderX 3.1.0 app-vue × × × × ×
钉钉小程序 快手小程序 飞书小程序 京东小程序
× × × ×
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari
× × × × ×

next-swipe-action适用于uni-app项目的滑动操作、左滑删除、滑动删除组件

本组件目前兼容微信小程序、H5、APP

遇到问题或有建议可以加入QQ群(455948571)反馈;
如果觉得组件不错,给五星鼓励鼓励咯;

vue3使用示例

<template>
    <view class="container">
        <view class="title"><text>next-swipe-action 演示demo</text></view>
        <view class="list" v-for="(item,index) in list" :key="index">
            <next-swipe-action :btnGroup="btnGroup" :disabled="index===2 || index===4" :index="index" @btnClick="onclick">
                <view class="item">
                    <image class="item-img" src="https://img0.baidu.com/it/u=2337762009,1252339875&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500">
                    </image>
                    <view class="item-name">{{item}}</view>
                </view>
            </next-swipe-action>
        </view>
    </view>
</template>
<script setup lang="ts">
    import { ref } from 'vue'

    const list = ref(['李先生','张小姐','武sir-禁用','黎先生','刘sir-禁用','欧阳小姐'])
    const btnGroup = ref([
        {
            name: '修改',
            action: 'edit',
            style: {
                bgColor: '#f9ae3d'
            }
        },
        {
            name: '删除',
            action: 'del',
            style: {
                bgColor: '#ff4d4f'
            }
        },
        {
            name: '审核',
            action: 'audit',
            style: {
                bgColor: '#b7eb8f'
            }
        },
    ]);
    //点击操作回调事件
    function onclick(e) {
        console.log('所点击的列表索引:' , e.index)
        console.log('所点击的按钮数据:' , e.item)
    }
</script>
<style scoped>
    .container {
        width: 100%;
        height: 100vh;
        background-color: #ffffff;
    }
    .title {
        color: #666;
        padding: 30rpx;

    }
    .list {
        width: 100%;
        margin-top: 1px;
    }

    .item {
        width: 100%;
        height: 120rpx;
        border-bottom: 1rpx solid #f0f0f0;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    .item-img {
        width: 80rpx;
        height: 80rpx;
        border-radius: 50%;
        margin-left: 30rpx;
    }

    .item-name {
        margin-left: 20rpx;
        font-size: 30rpx;
        color: #666666;
    }
</style>

属性说明

名称 类型 默认值 描述
index Number 0 当前列索引
disabled Boolean false 是否禁用左滑
btnGroup Array 默认显示编辑、删除 操作按钮数组信息,默认显示编辑、删除,可自定义传入
btnClickAutoReset Boolean true 按钮点击后是否重置

Event 事件

事件名 说明 类型 回调参数
btnClick 自定义按钮点击事件 emit Object

隐私、权限声明

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

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

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

许可协议

MIT协议

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