1、按钮控制view中的动画(向右隐藏向左显示)
效果图:
wxml代码:
<view class="container">
<view class="view-main" animation="{
{animationData}}"></view>
<button style="margin-top: 20px;" bindtap="bt_test">{
{
btTitle}}</button>
</view>
js代码:
// index.js
Page({
data: {
show: true,
btTitle:"隐藏"
},
onLoad() {
},
bt_test(e) {
console.log("333")
if (this.data.show) {
this.animationHide()
this.data.show = false
this.setData({
btTitle:"显示"
})
} else {