添加内容
发布于 6 年前 作者 chenqiang 10996 次浏览 来自 问答

这是我看到的一个案例教程    给  globalData  添加获取到的手机版本信息,但是我写完之后发现  globalData

没有我要的窗口宽高   连下面的console.log 也不显示,求大神帮帮指点一下。谢谢

App({

    globalData: {},

    onLaunch () {

        try {

            const res = wx.getSystemInfoSync();

    

            this.globalData.windowWidth = res.windowWidth;

            this.glabalData.windowHeight = res.windowHeight;

            console.log(1)

            } catch (e) {

        }

    },

})

1 回复

兄弟,是globalData不是glabalData

回到顶部