Skip to content

Commit

Permalink
added page events - #793
Browse files Browse the repository at this point in the history
  • Loading branch information
Gcaufy committed Jan 19, 2018
1 parent fdd80eb commit 05bca86
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/wepy/src/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import event from './event';
import util from './util';

const PAGE_EVENT = ['onLoad', 'onReady', 'onShow', 'onHide', 'onUnload', 'onPullDownRefresh', 'onReachBottom', 'onShareAppMessage'];
const PAGE_EVENT = ['onLoad', 'onReady', 'onShow', 'onHide', 'onUnload', 'onPullDownRefresh', 'onReachBottom', 'onShareAppMessage', 'onPageScroll', 'onTabItemTap'];
const APP_EVENT = ['onLaunch', 'onShow', 'onHide', 'onError'];


Expand Down Expand Up @@ -97,6 +97,7 @@ export default {
if (!this.$instance) {
app.$init(this, appConfig);
this.$instance = app;
this.$appConfig = appConfig;
}

// This is for test case
Expand All @@ -106,6 +107,9 @@ export default {

app.$wxapp = getApp();

APP_EVENT = APP_EVENT.concat(appConfig.appEvents || []);
PAGE_EVENT = PAGE_EVENT.concat(appConfig.pageEvents || []);

APP_EVENT.forEach((v) => {
config[v] = (...args) => {
let rst;
Expand Down

0 comments on commit 05bca86

Please sign in to comment.