首页 > 其他分享 >2022-10-24 记录uniapp根据条件编译从而使部分代码在不同的条件下生效

2022-10-24 记录uniapp根据条件编译从而使部分代码在不同的条件下生效

时间:2022-10-24 11:55:33浏览次数:52  
标签:24 10 uniapp 代码 endif H5 编译 条件

 

条件编译写法说明
#ifdef APP-PLUS
需条件编译的代码
#endif
仅出现在 App 平台下的代码
#ifndef H5
需条件编译的代码
#endif
除了 H5 平台,其它平台均存在的代码
#ifdef H5 || MP-WEIXIN
需条件编译的代码
#endif
在 H5 平台或微信小程序平台存在的代码(这里只有||,不可能出现&&,因为没有交集)

 

来源:https://uniapp.dcloud.net.cn/tutorial/platform.html#preprocessor

标签:24,10,uniapp,代码,endif,H5,编译,条件
From: https://www.cnblogs.com/iuniko/p/16821026.html

相关文章