uni-app三元表达式
一、vue和uniapp在class上添加判断的语法基本一致,在动态的class上做三元判断
:class=" "
<view class="shop_view" :class="brand_show||active_index||sort_show?'shop_view_active':''">
	<view class="nav">
	        <view @tap="active_nav" class="nav_modle" data-active_index="5">排序
	            <image class="nav_modle_img" src=""></image>
	        </view>
	</view>
</view>
二、微信小程序的class添加判断
与uniapp不同的是,原生微信小程序上做判断需要使用{{ }}
class=" "
<view class="shop_view {{brand_show||active_index||sort_show?'shop_view_active':''}}">
 
                    
                
 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号