uniapp里面设置onlaunch以后在加载页面调接口
main.js 里面
Vue.prototype.$onLaunched = new Promise(resolve => {
Vue.prototype.$isResolve = resolve
})
app.vue里面在异步执行完以后
this.$isResolve()
main.js 里面
Vue.prototype.$onLaunched = new Promise(resolve => {
Vue.prototype.$isResolve = resolve
})
app.vue里面在异步执行完以后
this.$isResolve()