When uni-app build tab, change the method of data can not be updated Boolean value of v-if
In the print function is to modify a success, but did not respond in the page
Layout is as follows:
<swiper :current="tabCur" class="swiper-box" duration="700" circular @change="changeDrawList"> <swiper-item class="tab-content" v-for="(items,indexs) in drawList" :key="indexs"> <scroll-view style="height: 100%; overflow: hidden;" scroll-y @scrolltolower="onBotton"> <!-- 加载loading图标 --> <view class="content" :style="{height:height1 + 'px'}" v-if="items.loadModal"> <view class="cu-load"> <view class="gray-text"> <view class="loading"> <text></text> <text></text> <text></text> <text></text> <text></text> </view> </view> </view> </view> <block v-else> <view class="ma-desc"> <text class="te-desc"> {{items.message}}</text> <text class="te-author">{{items.createTime}}</text> </view> <!- the work area -> <View class = "Draw-List"> <view class="drawItem" v-for="item in items.data" :key="item.draw_id"> <view class="draw"> <!-- 短边优先 --> <image :src="item.draw_image_url" mode="aspectFill" lazy-load></image> </view> <view class="drawAuthor"> <image :src="item.draw_tou"></image> <text class="name">{{item.draw_name}}</text> </view> </view> </view> </block> </scroll-view> </swiper-item> </swiper>
vue in operation:
getInfo () { the this .drawList [ the this .tabCur] = List;
// should be completed after the callback request provided the setTimeout (() => { // this.drawList [this.tabCur] to false .loadModal =; the this . $ SET ( the this .drawList [ the this .tabCur], "loadModal", to false ); // can not handle this, only the successfully modified values in the array of objects
the this $ forceUpdate ();. liberator // mandatory refresh }, 1500 ) ; }