game-btnani
v0.0.5
Published
# 游戏
Downloads
2
Readme
game-btnani
游戏
安装
npm install game-btnani
使用
- json
{
"usingComponents": {
"game-btnani": "game-btnani/game-btnani"
}
}
- mini.project.json
{
"node_modules_es6_whitelist": [
"game-btnani"
]
}
- js
Page({
data: {
btn1: {
name: "加载中",
imageUrl: "https://img.alicdn.com/imgextra/i2/1080040467/O1CN01Eyt5aM1FJvfEqhBu5_!!1080040467.png",
width: 72,
height: 24,
left: 339,
top: 656 - 162,
// autoPlay: true,
showPage: "start",
className: "rightMoveLeft",//"leftMoveRight",//"topMoveBottom",//"bottomMoveTop",
addClass: "activeAni",
delay: 1,
aniTime: "1",
// tapName: "",//自定义事件,如果没有默认handleTap
typeName: "none", //"tipDialog",
spmdName: "none"
},
},
handleTap(e) {
console.log("handleTap:", e);
},
onClickFun(e) {
console.log(e)
}
onRef(ref) {
this.aniRef = ref;
console.log("-----")
},
onInitDoneFun(e) {
// 动画组件初始化完成
console.log("初始化完成:", e)
this.aniRef.play();
},
onAniStartFun(e) {
// 动画按钮初始化完成
console.log("开始播放:", e)
},
onAniDoneFun(e) {
// 动画播放完成
console.log("播放完成:", e)
}
})
- xaml
<game-btnani component-data="{{btn1}}" onRef="onRef" onClickFun="onClickFun" onInitDone="onInitDoneFun" onAniStart="onAniStartFun" onAniDone="onAniDoneFun" />