if you want to achieve the flipping effect, you will encounter this problem: in the initial rendering, if the initial value of display is none, and the displayvalue is changed to block later through setdata, the content in the corresponding block will still not be displayed, but if the initial value is block, it will be fine to hide through setdata control. However, due to the need to achieve the flipping effect, there must be a block that defaults to none, front-end novice who does not know how to break. Ask the great god for advice, write a small example, thank you very much-sharp worship-sharp
my code snippet:
<block wx:for="{{list}}" wx:key="{{index}}">
<view class="container-body-box-item">
<view class="front" style="display:{{front_display_1}};width:{{front_width_1}}">
<image src="../../images/flipbtn.png" mode="widthFix" bindtap="fliptoback"></image>
//...
</view>
<view class="back" style="display:{{backt_display_1}};width:{{back_width_1}}">
<image src="../../images/flipbtn.png" mode="widthFix" bindtap="fliptofront"></image>
//...
</view>
</view>
</block>
because the need is to be used in the list, the front is displayed by default for the first rendering, and the width is 100%. When you click bindtap (each bindtap sets the number dataset:data-front_display_1,data-front_width_1,data-back_display_1,data-back_width_1, the number 1 is a cycle, the width on the front of the id), is reduced from 100% to 0, and then the back of the display:none; is reversed
.