网站建设的技能有哪些内容,临沂网站建设价格低,seo查询seo,怎么做直播视频教学视频网站uni.app如何检测小程序版本更新以及上线后如何关闭全局打印 检测小程序版本更新关闭全局打印 检测小程序版本更新 App.vue 入口文件中 添加如下代码 //检测小程序版本是否更新const updateManager wx.getUpdateManager()updateManager.onCheckForUpdate(function(res) {// 请求… uni.app如何检测小程序版本更新以及上线后如何关闭全局打印 检测小程序版本更新关闭全局打印 检测小程序版本更新 App.vue 入口文件中 添加如下代码 //检测小程序版本是否更新const updateManager wx.getUpdateManager()updateManager.onCheckForUpdate(function(res) {// 请求完新版本信息的回调console.log(res)})//更新版本updateManager.onUpdateReady(function() {wx.showModal({title: 更新提示,content: 新版本已经准备好是否重启应用,success(res) {if (res.confirm) {// 新的版本已经下载好调用 applyUpdate 应用新版本并重启updateManager.applyUpdate()}}})})updateManager.onUpdateFailed(function () {// 新版本下载失败})uni.getStorageSync()
微信小程序 测试 重新编译后 即可看到以下内容
关闭全局打印 在main.js中 加上以下代码 // 上线后全局关闭console.log打印
if (uni.getSystemInfoSync().platform ! devtools) {console.log () {};console.info () {};
}