Announcement: Tencent Cloud Mini Program Platform Renamed to Tencent Cloud Super App as a Service on January 2, 2025
Console Updates
Android SDK Updates
iOS SDK Updates
Flutter SDK Updates
IDE Updates
Base Library Updates
attribute | type | default | required | Introductions |
function | - | no | Lifecycle callback--Monitor Mini Program initialization. | |
function | - | no | Lifecycle callback--Monitor Mini Program start or swicth to the frontend. | |
function | - | no | Lifecycle callback--Monitor Mini Program swicth to the backend. | |
function | - | no | Error listener. | |
function | - | no | There is no listener function on the page. | |
function | - | no | Untreated Promise Rejects event listener functions. | |
function | - | no | Monitor subject changes | |
Other | any | - | no | Developers can add any function or data variable to Object Parameter, with the this Can access |
For the definition of Mini Programs and the mechanism for running Mini Programs, see Operation mechanism.
App({onPageNotFound(res) {wx.redirectTo({url: 'pages/...'}) // If it were Tabs Page, use the wx.switchTab}})
App({onLaunch (options) {// Do something initial when launch.},onShow (options) {// Do something when show.},onHide () {// Do something when hide.},onError (msg) {console.log(msg)},globalData: 'I am global data'})
attribute | type | default | required | Introductions |
allowDefault | boolean | false | no | in App Returns the default implementation when undefined. When the app is invoked, properties defined in the default implementation are overridden and incorporated into the app. Generally usedIndependent subcontracting |
// other.jsvar appInstance = getApp()console.log(appInstance.globalData) // I am global data
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback