LuckShake 摇一摇

参考 __VUE/luckshake/demo.vue,支持点击指针和真实摇动两种开奖方式。

演示

9:41

代码示例

<re-luck-shake :luckWidth="luckWidth" :luckHeight="luckHeight" rewardText="中奖啦" @shakeEvent="handleShakeEvent" @clickShake="handleClickShake" @endTurns="handleEndTurns" ></re-luck-shake>

引入

推荐使用 easycom 模式,配置后无需手动 import 即可直接使用 <re-luck-shake />。

API

LuckShake Props

名称类型默认值描述必传
isShakebooleanfalse-N
visiblebooleantrue-N
luckWidthstring'200px'-N
luckHeightstring'160px'-N
luckImgTopstring'https://img13.360buyimg.com/imagetools/jfs/t1/203344/20/16885/31149/61a07610E2520903c/899a906f039535b0.png'-N
luckImgBottomstring'https://img13.360buyimg.com/imagetools/jfs/t1/208979/10/10371/28087/61a07610Ee1e2f1b4/5b6fa12658906939.png'-N
clickPointstring'https://img11.360buyimg.com/ling/jfs/t1/104643/13/16899/24402/5e830316E70f93784/3f9e9b0d6e11db14.png'-N
shakeSpeednumber110-N
durationTimenumber1000-N
durationAnimationnumber1000-N
pointerStyleUTSJSONObject | nullnull-N
rewardTextstring'摇到 50 元券'-N
customStylestring''自定义样式N

LuckShake Events

名称参数描述
clickShake--
click-shake--
shakeEvent--
shake-event--
endTurnsreward: string-
end-turnsreward: string-

LuckShake Slots

名称描述
default默认插槽