1.在页面上判断不同的端

APP:APP端

APP端

H5:H5端

H5端

MP:小程序

小程序端

2.JS里面判断不同的端

APP:APP端

/*#ifdef APP-PLUS*/

console.log('APP端')

/*#endif*/

H5:H5端

/*#ifdef H5*/

console.log('H5端')

/*#endif*/

MP:小程序

/*#ifdef MP*/

console.log('微信小程序端')

/*#endif*/

3.CSS里面判断不同的端

APP:APP端

/*#ifdef APP-PLUS*/

top:0;

/*#endif*/

H5:H5端

/*#ifdef H5*/

top:88rpx;

/*#endif*/

MP:小程序

/*#ifdef MP*/

top:0;

/*#endif*/

推荐阅读

评论可见,请评论后查看内容,谢谢!!!评论后请刷新页面。