diff --git a/packages/wepy/src/base.js b/packages/wepy/src/base.js index 751e3d0a8..601681094 100644 --- a/packages/wepy/src/base.js +++ b/packages/wepy/src/base.js @@ -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']; @@ -97,6 +97,7 @@ export default { if (!this.$instance) { app.$init(this, appConfig); this.$instance = app; + this.$appConfig = appConfig; } // This is for test case @@ -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;