xieren 4 سال پیش
والد
کامیت
bdccdf4150
1فایلهای تغییر یافته به همراه9 افزوده شده و 7 حذف شده
  1. 9 7
      src/components/daily4StudyAbroad/material/CreateEdit.vue

+ 9 - 7
src/components/daily4StudyAbroad/material/CreateEdit.vue

@@ -280,14 +280,16 @@ export default {
   },
   mounted() {
     this.isVisible = true;
-    window.addEventListener("scroll", () => {
+    this.$nextTick(() => {
       const ele = document.getElementById("createEditDrawerBdWrap");
-      const top = ele.scrollTop;
-      if (top > 100) {
-        this.isShowBackTop = true;
-      } else {
-        this.isShowBackTop = false;
-      }
+      ele.addEventListener("scroll", () => {
+        const top = ele.scrollTop;
+        if (top > 100) {
+          this.isShowBackTop = true;
+        } else {
+          this.isShowBackTop = false;
+        }
+      });
     });
     this.loadOptions();
     this.loadAuthor();