注册程序

匿名 (未验证) 提交于 2019-12-03 00:21:02

App()

    App()


onLaunchFunction
onShowFunction
onHideFunction
onErrorFunction

onPageNotFoundFunction

Any  

App({   onLaunch: function(options) {     // Do something initial when launch.   },   onShow: function(options) {       // Do something when show.   },   onHide: function() {       // Do something when hide.   },   onError: function(msg) {     console.log(msg)   },   globalData: 'I am global data' })
pathString
queryObject
sceneNumber
shareTicketString
referrerInfoObject

referrerInfo.appIdString
referrerInfo.extraDataObject


1020
1035
1036
1037
1038
1043

onPageNotFound

pathString
queryObject
isEntryPageBoolean


App({   onPageNotFound(res) {     wx.redirectTo({       url: 'pages/...'     }) // 如果是 tabbar 页面,请使用 wx.switchTab   } })

getApp()

getApp()

// other.js var appInstance = getApp() console.log(appInstance.globalData) // I am global data

转载请标明出处:注册程序
文章来源: 注册程序
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!