uniapp 动态class

<image class="img1" 
    :class="[{‘img1‘:index == 0},{‘img2‘:index == 1},{‘img3‘:index == 2}]"
    :src="avtUrl" 
    lazy-load="true"
    mode="aspectFill"
    v-for="(avtUrl, index) in imgList.UserImgList"
    :key="index">
</image>

:class="[{‘类名‘:条件},{‘类名‘:条件},{‘类名‘:条件}]"

为不同条件的image绑定不同的样式

uniapp 动态class

上一篇:Glide异常:Failed to find GeneratedAppGlideModule 解决实践


下一篇:小米商城顶部导航