![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
微信小程序
前端小白在写bug
这个作者很懒,什么都没留下…
展开
-
uniapp中onLaunch异步方法与onLoad执行顺序问题
uniapp中onLaunch异步方法与onLoad执行顺序问题问题描述:uniapp中,app.vue里的onLaunch中如果有异步方法,比如登录方法,返回结果可能会在页面的 onLoad 之后,为了让页面的 onLoad 在 onLaunch 之后执行,使用以下解决方案:1、main.js添加如下代码Vue.prototype.$onLaunched = new Promise(resolve => { Vue.prototype.$isResolve = resolve})2原创 2021-03-04 19:49:30 · 4296 阅读 · 5 评论 -
微信小程序检测版本更新
微信小程序检测版本更新原生小程序在app.js中写如下代码onLaunch() { if (wx.canIUse('getUpdateManager')) { const updateManager = wx.getUpdateManager() updateManager.onCheckForUpdate(function (res) { console.log('onCheckForUpdate====', res) // 请求完新版本信息的回调原创 2021-02-20 14:56:18 · 546 阅读 · 0 评论