Browse Source

修改红点

lex-xin 4 năm trước cách đây
mục cha
commit
51774e2fdb
1 tập tin đã thay đổi với 10 bổ sung7 xóa
  1. 10 7
      src/store/modules/app.js

+ 10 - 7
src/store/modules/app.js

@@ -51,14 +51,17 @@ const mutations = {
 const toggleDot = status => {
   const { indexErrData, remindMatterData } = status
   const dotStatus =  indexErrData || remindMatterData
-  const el = document.querySelector('.menu-wrapper a[href="#/main/main"] span')
-  if (el) {
-    if (dotStatus) {
-      el.classList.add('main-dot')
-    } else {
-      el.classList.remove('main-dot')
+  setTimeout(() => {
+    // const el = document.querySelector('.menu-wrapper a[href="#/main/main"] span')
+    const el = document.querySelector('.el-scrollbar__view a.indexlayout-top-menu-li[href="#/main"] span')
+    if (el) {
+      if (dotStatus) {
+        el.classList.add('main-dot')
+      } else {
+        el.classList.remove('main-dot')
+      }
     }
-  }
+  }, 300);
 }
 
 const actions = {