diff --git a/src/back-top/_example/back-top.ts b/src/back-top/_example/back-top.ts index 1b9c47e1a..53e08be00 100644 --- a/src/back-top/_example/back-top.ts +++ b/src/back-top/_example/back-top.ts @@ -46,4 +46,8 @@ Page({ this.setData({ backTopDemo: backTopDemos[index] }); wx.pageScrollTo({ duration: 300, scrollTop: 1000 }); }, + + onToTop(e: any) { + console.log('backToTop', e); + }, }); diff --git a/src/back-top/_example/back-top.wxml b/src/back-top/_example/back-top.wxml index 04ac6e01c..1aee3983b 100644 --- a/src/back-top/_example/back-top.wxml +++ b/src/back-top/_example/back-top.wxml @@ -52,6 +52,7 @@ - + + diff --git a/src/back-top/back-top.ts b/src/back-top/back-top.ts index b535cf81d..b962418cc 100644 --- a/src/back-top/back-top.ts +++ b/src/back-top/back-top.ts @@ -26,6 +26,7 @@ export default class BackTop extends SuperComponent { * Component methods */ toTop() { + this.triggerEvent('toTop'); wx.pageScrollTo({ scrollTop: 0, duration: 300,