欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

html不同平台,基于H5端自定义平台怎么使用和H5端不一样的index.html?

发布时间:2024/9/19 38 豆豆
生活随笔 收集整理的这篇文章主要介绍了 html不同平台,基于H5端自定义平台怎么使用和H5端不一样的index.html? 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

当前配置

版本

{

"@dcloudio/uni-app-plus": "^2.0.0-26920200403001",

"@dcloudio/uni-h5": "^2.0.0-26920200403001",

"@dcloudio/uni-helper-json": "*",

"@dcloudio/uni-mp-alipay": "^2.0.0-26920200403001",

"@dcloudio/uni-mp-baidu": "^2.0.0-26920200403001",

"@dcloudio/uni-mp-qq": "^2.0.0-26920200403001",

"@dcloudio/uni-mp-toutiao": "^2.0.0-26920200403001",

"@dcloudio/uni-mp-weixin": "^2.0.0-26920200403001",

"@dcloudio/uni-stat": "^2.0.0-26920200403001",

}

自定义平台配置

package.json

"uni-app": {

"scripts": {

"h5-weixin": {

"title":"微信服务号",

"BROWSER":"Chrome",

"env": {

"UNI_PLATFORM": "h5"

},

"define": {

"H5-WEIXIN": true

}

}

}

}

自定义h5的template配置

mainfest.json

"h5": {

"title": "H5 - Page",

"template": "../public/h5.html"

},

需求

当前项目需要发布到H5端和自定义的H5-WEIXIN端;

在自定义的H5-WEIXIN端需要使用与H5端不同的template配置,比如使用配置 ../public/h5-weixin.html;

求指导

发现在template配置项对应的文件中不支持条件编译,求指导还有什么办法能实现基于H5平台的自定义平台编译时使用不同的template?

感谢

总结

以上是生活随笔为你收集整理的html不同平台,基于H5端自定义平台怎么使用和H5端不一样的index.html?的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。