Skip to content

Commit

Permalink
Merge pull request Meituan-Dianping#259 from F-loat/develop
Browse files Browse the repository at this point in the history
optimize: 事件处理函数不存在时输出提示
  • Loading branch information
anchengjian authored Apr 12, 2018
2 parents 323b793 + 5db1647 commit 2ab3c8b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/platforms/mp/runtime/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,10 @@ export function handleProxyWithVue (e) {
if (handles.length) {
const event = getWebEventByMP(e)
handles.forEach(h => h(event))
} else {
const currentPage = vm.$mp.page.route
console.group(new Date() + ' 事件警告')
console.warn(`Do not have handler in current page: ${currentPage}. Please make sure that handler has been defined in ${currentPage}, or ${currentPage} has been added into app.json`)
console.groupEnd()
}
}

0 comments on commit 2ab3c8b

Please sign in to comment.