Jelajahi Sumber

更新路由和页面

reghao 2 tahun lalu
induk
melakukan
62dd5f545d
2 mengubah file dengan 23 tambahan dan 5 penghapusan
  1. 18 5
      src/components/layout/NavBar.vue
  2. 5 0
      src/router/index.js

+ 18 - 5
src/components/layout/NavBar.vue

@@ -8,11 +8,6 @@
           <span>bili</span>
         </a>
       </el-col>
-      <el-col :sm="1" class="right">
-        <a href="/status" class="tit">
-          <span>状态</span>
-        </a>
-      </el-col>
       <el-col :sm="1" class="right">
         <a href="/video" class="tit">
           <span>视频</span>
@@ -28,6 +23,11 @@
           <span>图片</span>
         </a>
       </el-col>
+      <el-col :sm="1" class="right">
+        <a href="/article" class="tit">
+          <span>文章</span>
+        </a>
+      </el-col>
       <el-col :sm="1" class="right">
         <a href="/discover" class="tit">
           <span>发现</span>
@@ -83,6 +83,11 @@
               class="size"
               @click.native="goToProfile"
             >我的帐号</el-dropdown-item>
+            <el-dropdown-item
+              icon="el-icon-more"
+              class="size"
+              @click.native="goToTimeline"
+            >时间线</el-dropdown-item>
             <el-dropdown-item
               icon="el-icon-s-home"
               class="size"
@@ -201,6 +206,14 @@ export default {
       this.dialogVisible2 = false
       this.dialogVisible = true
     },
+    goToTimeline() {
+      const path = '/timeline'
+      if (this.$route.path === path) {
+        this.$router.go(0)
+        return
+      }
+      this.$router.push(path)
+    },
     goToHome() {
       const path = '/user/' + this.user.userId
       if (this.$route.path === path) {

+ 5 - 0
src/router/index.js

@@ -105,6 +105,11 @@ const routes = [
     name: 'TimelineIndex',
     component: TimelineIndex
   },
+  {
+    path: '/timeline',
+    name: 'TimelineIndex',
+    component: TimelineIndex
+  },
   {
     path: '/status/:statusId',
     name: 'StatusPage',