<view class="answer-list"> <view class="answer" wx:for="{{curQuestion.answerList}}" wx:key="index" bindtap="answerClick" data-index="{{index}}"> <view style="background:{{curQuestion.answerFlag && item.realFlag?'#1CC18D':(curQuestion.answerFlag && !item.realFlag && curQuestion.curIndex == index ? '#FA6C6C':'#fff')}};color:{{curQuestion.answerFlag && (item.realFlag || curQuestion.curIndex == index)?'#fff':'#000'}}" class="answer-item"> {{item.name}}</view> <view class="icon-box" wx:if="{{curQuestion.answerFlag && (item.realFlag || curQuestion.curIndex == index)}}"> <text wx:if="{{curQuestion.answerFlag && !item.realFlag && curQuestion.curIndex == index}}" class="cuIcon-roundclosefill choose-fail"></text> <text wx:if="{{curQuestion.answerFlag && item.realFlag}}" class="cuIcon-roundcheckfill choose-success"></text> </view> </view> </view> 转uniapp写法
时间: 2024-03-28 07:36:26 浏览: 49
微信小程序自定义底部弹出框功能
<view class="answer-list">
<view class="answer" v-for="(item, index) in curQuestion.answerList" :key="index" @tap="answerClick" :data-index="index">
<view :style="{background: curQuestion.answerFlag && item.realFlag ? '#1CC18D' : (curQuestion.answerFlag && !item.realFlag && curQuestion.curIndex == index ? '#FA6C6C' : '#fff'), color: curQuestion.answerFlag && (item.realFlag || curQuestion.curIndex == index) ? '#fff' : '#000'}" class="answer-item">
{{item.name}}
</view>
<view class="icon-box" v-if="curQuestion.answerFlag && (item.realFlag || curQuestion.curIndex == index)">
<text v-if="curQuestion.answerFlag && !item.realFlag && curQuestion.curIndex == index" class="cuIcon-roundclosefill choose-fail"></text>
<text v-if="curQuestion.answerFlag && item.realFlag" class="cuIcon-roundcheckfill choose-success"></text>
</view>
</view>
</view>
阅读全文