前言
调试基础库 2.12.0开发者工具 1.03.270wx:for
定义数据
Page({data: {noticeType: 1,},...})
显示通知类型
<text wx:if="{{1==noticeType}}">通知</text>
if… elseif…else
定义数据
Page({data: {noticeType: 1,},...})
显示通知类型
<view class="attrs"><text wx:if="{{1==noticeType}}">通知</text><text wx:elif="{{2==noticeType}}">公告</text><text wx:else>-</text></view>
效果
参考
https://developers./miniprogram/dev/reference/wxml/conditional.html