Loading... 语法: ```css // #ifdef %PLATFORM% 这些代码只在该平台编译 // #endif //#ifndef H5 || APP-PLUS || MP-ALIPAY ``` ```css #ifdef : if defined 仅在某个平台编译 #ifndef : if not defined 在除里该平台的其他编译 #endif : end if 结束条件编译 %PLATFORM% 需要编译的平台,上面的MP就是各个小程序的意思 ``` ``` uni-app支持的各个平台 ``` | 值 | 平台 | 参考文档 | | --------------- | -------------------------------------------------------- | ----------------------------------------------------------------------------- | | APP-PLUS | 5+App | [HTML5+ 规范](http://www.html5plus.org/doc/) | | APP-PLUS-NVUE | 5+App nvue | [Weex 规范](https://weex.apache.org/cn/guide/) | | H5 | H5 | | | MP-WEIXIN | 微信小程序 | [微信小程序](https://developers.weixin.qq.com/miniprogram/dev/api/) | | MP-ALIPAY | 支付宝小程序 | [支付宝小程序](https://docs.alipay.com/mini/developer/getting-started) | | MP-BAIDU | 百度小程序 | [百度小程序](https://smartprogram.baidu.com/docs/develop/tutorial/codedir/) | | MP-TOUTIAO | 头条小程序 | [头条小程序](https://developer.toutiao.com/docs/framework/) | | MP-QQ | QQ小程序 | (目前仅cli版支持) | | MP | 微信小程序/支付宝小程序/百度小程序/头条小程序/QQ小程序 | | 最后修改:2021 年 06 月 29 日 © 允许规范转载 打赏 赞赏作者 微信 赞 0 如果觉得我的文章对你有用,请随意赞赏
此处评论已关闭