diff --git a/src/core/service/bridge/subscribe.js b/src/core/service/bridge/subscribe.js index 1f9e474f7a663cf1327b8edb05fc4a25a48fa385..c5e6dee2dd0a9d68f2381b2d1e442f1b83b0d108 100644 --- a/src/core/service/bridge/subscribe.js +++ b/src/core/service/bridge/subscribe.js @@ -9,13 +9,13 @@ export default function initSubscribe (subscribe, { getCurrentPages }) { function createPageEvent (eventType) { - return function (args, pageId) { + return function (args, pageId) { pageId = parseInt(pageId) const pages = getCurrentPages() const page = pages.find(page => page.$page.id === pageId) if (page) { callPageHook(page, eventType, args) - } else { + } else if (process.env.NODE_ENV !== 'production') { console.error(`Not Found:Page[${pageId}]`) } } @@ -48,7 +48,7 @@ export default function initSubscribe (subscribe, { } callback(res) } - } + } if (__PLATFORM__ === 'h5') { subscribe('onPageReady', createPageEvent('onReady')) @@ -59,4 +59,4 @@ export default function initSubscribe (subscribe, { subscribe('onRequestComponentInfo', onRequestComponentInfo) subscribe('onRequestComponentObserver', onRequestComponentObserver) -} +}