关注公众号:青山有路

小程序页面wxml中if else

全部 admin 7年前 (2017-11-15) 2579次浏览 已收录 0个评论 扫描二维码
小程序页面wxml中if else
wxml if else 使用如下:
<text class=”title2″ wx:if=”{{store.service_all_day==1}}”>24小时营业{{store.in_business == ‘1’ ? ‘营业中’ : ‘休息中’}}</text>
<textclass=”title2″wx:elseif=”{{store.service_all_day==2}}>营业时间{{store.service_starttime}}到{{store.sevevice_end_time}} {{store.in_business == ‘1’ ? ‘营业中’ : ‘休息中’}}</text>
下面是我在使用中遇到的坑:三目运算中store.service_starttime和store.sevevice_end_time里面有冒号,导致变量解析不了,所以才换成了上面的写法:
{{store.in_business == ‘1’ ? ‘营业中store.service_starttime’ : ‘休息中store.sevevice_end_time’}}

版权所有丨如未注明 , 均为原创 , 转载请注明小程序页面wxml中if else
喜欢 (0)

Warning: Use of undefined constant PRC - assumed 'PRC' (this will throw an Error in a future version of PHP) in /www/wwwroot/gaowenjie.cc/wp-content/themes/Git-alpha/comments.php on line 17
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到