新建项目
网上的大多数资料都hbuild,现在官方版本是HbuildX。先新建一个H5+的项目
生成后的目录结构
- unpackage是用来放图片的
- inex 是vue的页面
- mainfest.json是关于打包的一些配置

关于mainfest.json的配置
可以看这个博主写的 很详情: https://www.cnblogs.com/taohuaya/p/10263519.html
点击按钮自动更新软件
// 将这行代码放到index.html中,放在vue的mouted和created中会报错。有大神弄好可以告诉下## inde.html<script>// 用来做安卓版本更新document.addEventListener("plusready",function() {console.log(JSON.stringify("121212"));},false);</script>// 点击升级按钮
// 运行的时候plus 一定要ready不然会报错## home.vueversionUP() {let ver ='1.0.1';plus.runtime.getProperty(plus.runtime.appid, function(inf) {// hbuild自带的全局弹窗方法plus.nativeUI.showWaiting("下载中...");if (+inf.version.slice(".").replace(/\./g, "") < +ver.replace(/\./g, "")) {// plus.nativeUI.toast("正在准备环境,请稍后!");var dtask = plus.downloader.createDownload("https://files.sumi.io/grid-diary-china-latest.apk",{},function(d, status) {plus.nativeUI.closeWaiting();if (status == 200) {var path = d.filename; //下载apkplus.runtime.install(path); // 自动安装apk文件} else {plus.nativeUI.alert("版本更新失败:" + status);}});dtask.start();}});},
H5+:的文档 https://www.dcloud.io/docs/api/


