Native micro-channel applet lifecycle

Applet lifecycle methods:
OnLaunch: function () {
Fires when the startup applet
small program will only start once, usually when opened for the first time
usually only triggered once
},
onShow: function () {
When the applet from the background trigger cut into the foreground
}
onHide: function () {
when the applet is triggered when cut from the foreground to the background
}
onError: function () {
when the applet appears abnormal trigger
}
onPageNoteFound: function () {
Fires when not found page
}

Lifecycle function applet pages:
page corresponding js file
Page ({
life cycle:
the onLoad: function () {
triggered when the current page loads
when the page is loaded, the transmission request acquiring data
},
onShow: function () {
when the current page data displayed on the page
},
the onReady: function () {
the initial rendering completion trigger performed once
},
onHide: function () {
triggered when the current page invisible
}
});

tips: a small program, using this.data property to access the data.

Guess you like

Origin www.cnblogs.com/JiAyInNnNn/p/11274098.html