首页 > 编程知识 正文

微信小程序开发 修改globalData的值,微信开发微信小程序

时间:2023-05-05 21:28:35 阅读:274326 作者:1255

非app.js的页面: var app = getApp();app.globalData.userName = "xxx"; app.js:

在onLaunch函数中:(var that = this;必须写在onlaunch()开始)

onLaunch: function () { var that = this; that.globalData.userName = "xxx"; },

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。