浏览代码

修复第二次点击通知图标跳转404的问题

Sanmu8 1 年之前
父节点
当前提交
1d24e7e378
共有 1 个文件被更改,包括 8 次插入3 次删除
  1. 8 3
      src/layout/components/HeaderNotice.vue

+ 8 - 3
src/layout/components/HeaderNotice.vue

@@ -12,9 +12,9 @@
 <!--    </el-popover>-->
 <!--    </el-badge>-->
     <el-badge :value="this.listByusers" class="item" :max="99">
-      <router-link to="task/task">
-        <i class="el-icon-bell" style="color: white"></i>
-      </router-link>
+      <!-- <router-link to="task/task"> -->
+        <i class="el-icon-bell" style="color: white" @click="goTask"></i>
+      <!-- </router-link> -->
     </el-badge>
   </div>
 </template>
@@ -49,6 +49,11 @@ export default {
   mounted() {
   },
   methods: {
+    goTask(){
+      if(this.$route.path != '/task/task'){
+        this.$router.push({path:'task/task'})
+      }
+    },
     /** 查询待办信息 */
     getNotice() {
       this.loading = true;