文章
2022-06-13
来自:开发者社区
关于微信小程序在app.js修改后的全局变量值在其他页面异步获取的问题
前言虽然app.js先于index.js。但是修改app.js中的全局变量是异步请求,如果你想在index.js里获取app.js修改后的值,那么需要使用promise来实现异步。app.js//app.js App({ globalData: { userInfo: null }, // 检测授权 getauthor: function ...
本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。
产品推荐
{"cardStyle":"productCardStyle","productCode":"aliyun","productCardInfo":{"productTitle":"一站式快速开发多平台小程序","productDescription":"本方案使用阿里云多端低代码开发平台魔笔低代码快速搭建适配于微信、支付宝等多平台的小程序,帮助您提升开发效率、降低维护成本。","productContentLink":"https://www.aliyun.com/solution/tech-solution/develop-applets","isDisplayProductIcon":true,"productButton1":{"productButtonText":"方案详情","productButtonLink":"https://www.aliyun.com/solution/tech-solution/develop-applets"},"productButton2":{"productButtonText":"一键部署","productButtonLink":"https://help.aliyun.com/document_detail/2715331.html"},"productButton3":{"productButtonText":"查看更多技术解决方案","productButtonLink":"https://www.aliyun.com/solution/tech-solution/"},"productPromotionInfoBlock":[{"$id":"0","productPromotionGroupingTitle":"解决方案推荐","productPromotionInfoFirstText":"云上经典架构","productPromotionInfoFirstLink":"https://www.aliyun.com/solution/tech-solution/habwoc","productPromotionInfoSecondText":"高效构建企业门户网站","productPromotionInfoSecondLink":"https://www.aliyun.com/solution/tech-solution/build-a-website"}],"isOfficialLogo":false},"activityCardInfo":{"activityTitle":"","activityDescription":"","cardContentBackgroundMode":"LightMode","activityContentBackgroundImageLink":"","activityCardBottomInfoSelect":"activityPromotionInfoBlock"}}
阿里小程序云
阿里小程序云官方技术圈
+关注