<view wx:if="{{condition}}"> True </view>
- <view wx:if="{{length > 5}}"> 1 </view>
- <view wx:elif="{{length > 2}}"> 2 </view>
- <view wx:else> 3 </view>
npm i @vant/weapp -S --production
安装完成后修改app.json,将 app.json 中的 "style": "v2" 去除- {
- ...
- "compilerOptions": {
- ...
- "baseUrl": ".",
- "types": ["miniprogram-api-typings"],
- "paths": {
- "@vant/weapp/*": ["path/to/node_modules/@vant/weapp/dist/*"]
- },
- "lib": ["ES6"]
- }
- }