z***@126.com
z***@126.com
  • 发布:2021-02-03 10:27
  • 更新:2021-02-18 11:37
  • 阅读:688

【报Bug】3.1.0版本动态绑定class失效了

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 10.15.3

HBuilderX类型: Alpha

HBuilderX版本号: 3.1.0

手机系统: iOS

手机系统版本号: IOS 14

手机厂商: 苹果

手机机型: 12 mini

页面类型: nvue

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

<swiper :circular="true" class="swiperBx" :current="current" @change="swiperChange" :indicator-dots="false" :autoplay="autoplay" :interval="3000" :duration="1000">
<swiper-item class="swiper-item" v-for="(item,index) in lists" @tap="app.toEvent(item)" :key="index">
<image class="img" :src="item.pic_url" mode="aspectFill"></image>
</swiper-item>
</swiper>
<view class="dotPoint">
<text v-for="(item,index) in lists" :class="current===index?'dot dotCurr':'dot'" :key="index"></text>
</view>

操作步骤:

写个swiper获取当前页,赋值给current,写个指示点 动态根据current改变高亮样式

预期结果:

样式跟随当前页 变成高亮

实际结果:

样式没有任何变化

bug描述:

自定义轮播图都指示点,动态绑定class :class="current===index?'dot dotCurr':'dot'"失效了

2021-02-03 10:27 负责人:无 分享
已邀请:
DCloud_UNI_GSQ

DCloud_UNI_GSQ

提供一个可以运行的工程,我试试

  • WbsPool

    在list 与 scrollw-view 动态修改样式会失效

    2021-02-04 17:21

  • DCloud_UNI_GSQ

    回复 WbsPool: 好的,已初步定位

    2021-02-05 16:36

z***@126.com

z***@126.com (作者) - 没有

今天的3.1.1我发现解决了

  • DCloud_UNI_GSQ

    没解决,默认关闭了新版样式编译器

    2021-02-05 16:36

DCloud_UNI_GSQ

DCloud_UNI_GSQ

你的是不是也在 list 组件里面?

DCloud_UNI_GSQ

DCloud_UNI_GSQ

HBuilderX 3.1.2 已经修复

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