uniapp常见开发有三端:app、H5、微信小程序
html兼容:
<!-- #ifdef H5 -->
H5代码
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
APP代码
<!-- #endif -->
js兼容:
//#ifdef APP-PLUS
需要条件编译的js代码(APP平台)
//#endif
//#ifdef H5 || MP-WEIXIN
需要条件编译的js代码(H5平台或者微信小程序平台)
//#endif
css兼容:
/* #ifdef APP-PLUS */
APP样式代码
/* #endif */