小程序生命周期: //index.jsPage({ data: { text: “This is page data.” }, onLoad: function(options) { // 页面创建时执行 }, onShow: function() { // 页面出现在前台时执行 }, onReady: function() { // 页面首次渲染完毕时执行 }, onHide: function() { // 页面从前台变为后台时执行 }, onUnload: function() { // 页面销毁时执行 }, onPullDownRefresh: function() { // 触发下拉刷新时执行 }, onReachBottom: function() { // 页面触底时执行 }, onShareAppMessage: function () { // 页面被用户分享时执行 }, onPageScroll: function() { // 页面滚动时执行 }, onResize: function() { // 页面尺寸变化时执行 }, onTabItemTap(item) { // tab 点击时执行 console.log(item.index) console.log(item.pagePath) console.log(item.text) }, // 事件响应函数 viewTap: function() { this.setData({ text: ‘Set some data for updating view.’ }, function() { // this is setData callback }) }, // 自由数据 customData: { hi: ‘MINA’ }})
小程序生命周期
未经允许不得转载:E企盈小程序开发-热线:4006-838-530 » 小程序生命周期
最新评论
好文推荐
好文推荐
666666