The problem of display rendering when realizing the flip effect in Mini Program

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

.
Jun.25,2021

wxml

  <view class="container-body-box-item {{isInFront?'':'show-back'}}" bindtap="flipCard">
    <view class="front">
      <view></view>
    </view>
    <view class="back">
      <view></view>
    </view>
  </view>

wxss

.container-body-box-item{
  width: 200px;
  height: 200px;
  transform:perspective(800px) rotateY(0deg);
  transition:1s;
  transform-style:preserve-3d;
}
.container-body-box-item.show-back{
  transform:perspective(800px) rotateY(-180deg);
}
.front, .back{
  width: 100%;
  height: 100%;
  left:0;
  top: 0;
  color: -sharpfff;
}
.front{
  background: pink;
  position: absolute;
  transform:translateZ(1px);
}
.back{
  background: yellowgreen;
  transform:translateZ(-1px) rotateY(180deg);
}

js

data: {
    isInFront: true
}

...

 flipCard: function(){
    this.setData({
      isInFront: !this.data.isInFront
    })
 }
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b40cbf-41582.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b40cbf-41582.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?