// wxml
<view bindtap="clk">
<view class="clk"></view>
<view>
<view wx:key="{{key}}" wx:for="{{arr}}" class="child{{!isShow?' hide':''}}">
<view class="lis">
<text>{{item.txt}}</text>
</view>
</view>
</view>
</view>
// wxss
.clk {
background: Red;
}
.child {
transition: all .6s ease;
height: 80rpx; //auto,
opacity:1;
}
.hide {
height: 0;
opacity:0;
}
//js
data: {
isShow: true,
arr: [
{txt: 1},
{txt: 2},
{txt: 3}
]
},
clk() {
this.setData({
'isShow': !this.data.isShow
})
},
this is the first view view view0 what I want to make is that when the button is clicked, the content is displayed corresponding to the button. ...