Conditional compilation is cross-terminal compatible.
For example
, write in comments and
only display in h5
<!--#ifdef -->
<view>我只在h5中显示</view>
<!--#endif -->
```<!-- MP-WEIXIN 显示平台,具体参考官网 -->
<!--#ifdef MP-WEIXIN -->
<view>我只在微信小程序中显示</view>
<!--#engif -->
The function or style is only displayed on a certain platform, and the method is the same.
// #ifdef
....
//#endif