From 95d0e5524c3ab1e55a9909e2c38e7cc35901220f Mon Sep 17 00:00:00 2001 From: 劉鈞霖 <benson@gmail.com> Date: 星期三, 15 十二月 2021 14:52:58 +0800 Subject: [PATCH] [ Update ] :新增 pamService class 將 consultant interface 移出 --- PAMapp/components/Ui/UiGoToTop.vue | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/PAMapp/components/Ui/UiGoToTop.vue b/PAMapp/components/Ui/UiGoToTop.vue index 803cf3f..2fe1bd7 100644 --- a/PAMapp/components/Ui/UiGoToTop.vue +++ b/PAMapp/components/Ui/UiGoToTop.vue @@ -18,7 +18,7 @@ created() { if (process.browser) { - window.onscroll = () => { this.scrollFunction() }; + document.body.addEventListener('scroll', this.scrollFunction); } } @@ -34,6 +34,10 @@ document.body.scrollTop = 0; document.documentElement.scrollTop = 0; } + + destroyed() { + document.body.removeEventListener('scroll', this.scrollFunction); + } } </script> -- Gitblit v1.8.0