更新记录

1.1(2020-10-14)

  • 修复 点击事件相关变量共用导致事件偶尔出错问题

1.0(2020-10-13)

  • create

平台兼容性

Attributes

props: {
    startAnimationType: {   //触发动画事件
        type: String,
        default: 'tap'
    },
    animationType: {    //动画类型
        type: String,
        default: 'jump'
    },
    animationFinishClick: { //在动画完成后触发点击事件
        type: [Boolean, String],
        default: true
    },
    animationFinishClickDurationScale: {    //subsection为true时,触发点击事件时间为动画总时长乘以该系数
        type: [String, Number],
        default: .75
    },
    animationFinishClickMoveThreshold: {    //subsection为true时,手指点击后离开时-距离点击时的距离若在该阈值内则触发点击事件
        type: [String, Number],
        default: 0
    },
    subsection: {   //分段式动画(手指点击时与离开后)
        type: [Boolean, String],
        default: true
    }
}

Events

事件名 说明 形参
click 点击事件

示例代码

<template>
    <view class="content">
        <QSAnimation @click="click">
            <view class="box">
                <image class="image" src="/static/logo.png" mode="widthFix"></image>
                <text class="text">默认:跳跃</text>
            </view>
        </QSAnimation>
        <QSAnimation animationType="pendant" @click="click">
            <view class="box">
                <image class="image" src="/static/logo.png" mode="widthFix"></image>
                <text class="text">挂件</text>
            </view>
        </QSAnimation>
        <QSAnimation animationType="shook" @click="click">
            <view class="box">
                <image class="image" src="/static/logo.png" mode="widthFix"></image>
                <text class="text">拒绝:摇晃</text>
            </view>
        </QSAnimation>
        <QSAnimation animationType="elasticity_Y" @click="click">
            <view class="box">
                <image class="image" src="/static/logo.png" mode="widthFix"></image>
                <text class="text">Y-弹性</text>
            </view>
        </QSAnimation>
    </view>
</template>
import QSAnimation from '@/components/QS-Animation/QS-Animation.vue';
    export default {
        components: {
            QSAnimation
        },
        methods: {
            click() {
                uni.showToast({
                    title: '点击了'
                })
            }
        }
    }

隐私、权限声明

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

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

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

许可协议

MIT协议

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