2***@qq.com
2***@qq.com
  • 发布:2021-01-11 22:26
  • 更新:2021-01-11 22:26
  • 阅读:614

vue class及style动态绑定的写法在小程序里解析错误,是否可以修复下?

分类:uni-app

我的写法:
style:

<view class="hot-tags">  
                <view v-for="(item, index) in hotTagsList" :key="index" class="hot-tags-item">  
                    <text>{{item.title}}</text>  
                    <view :class="item.bgClass" :style="item.image ? [{'background-image': 'url(' + item.image + ')'}] : ''" class="liner-gradient"></view>  
                </view>  
            </view>

解析出来:

style="{{(item.image?[{'background-image':'url('+item.image+')'}]:'')}}"

语法不对。报错。

class <view :class="{isauto ? hotTags : coldTags}">

解析出来:

<view class="{{[isauto ? hotTags : coldTags]}}">

语法不对。错误。

以上只有手动删除才能解决问题。繁琐。

2021-01-11 22:26 负责人:无 分享
已邀请:

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