dukai
dukai
  • 发布:2021-10-22 11:35
  • 更新:2021-11-24 10:23
  • 阅读:405

【报Bug】uniapp华为快应用数据状态修改,页面状态未刷新

分类:uni-app

产品分类: uniapp/快应用/华为

渲染模式: webview

示例代码:

类似代码:
// #ifdef QUICKAPP-WEBVIEW-HUAWEI
this.bannerList = [];
// #endif
this.$nextTick(() => {
this.bannerList = firstPageData.brandHeadFocusDROList; // banner轮播列表
});

操作步骤:

华为快应用请求接口返回数组list,页面未渲染

预期结果:

页面跟随数据渲染

实际结果:

页面未动态渲染

bug描述:

请求接口之后,页面返回数组列表list,状态更新,页面使用v-for渲染,界面未更新状态,this.$forceUpdate()不起作用;使用过this.$set也不得行,目前的唯一方式就是把list清空之后,使用this.$nextTick,页面会渲染出来,但是有两个问题,一、工作量巨大;二、页面会抖动;

2021-10-22 11:35 负责人:无 分享
已邀请:
b***@gmail.com

b***@gmail.com

快应用同样碰到这个Bug。

        <swiper class="tab-box" ref="swiper1" :autoplay="false" :current="tabIndex" :duration="300"  
                @change="onswiperchange" @transition="onswiperscroll" @animationfinish="animationfinish">  
                <swiper-item v-for="(page, index) in tabList" :key="index">  
                    <goodsList class="page-item" :ref="'page' + index" @onGoodsClickCheckbox="onGoodsClickCheckbox">  
                    </goodsList>  
                </swiper-item>  
            </swiper>

我发现不是页面没刷新,而是他数组更新之后刷新的还是第一个页面。看到有一个解决方案是通过在v-for之前加上v-if 判断数据是否存在来渲染。但跟我当前结构并不符合。我是在goodlist组件中执行加载数据方法。

该问题目前已经被锁定, 无法添加新回复