Browse Source

添加管理食物,管理路由之间的跳转

Mr.Jiu 4 years ago
parent
commit
265b523adf
2 changed files with 13 additions and 5 deletions
  1. 6 0
      src/views/recipe/food.vue
  2. 7 5
      src/views/recipe/step.vue

+ 6 - 0
src/views/recipe/food.vue

@@ -51,6 +51,9 @@
       >
         添加
       </el-button>
+      <el-button class="filter-item" type="primary" @click="toStep()">
+        步骤管理
+      </el-button>
     </div>
 
     <el-table
@@ -253,6 +256,9 @@ export default {
         onEnd: evt => {
         }
       })
+    },
+    toStep() {
+      this.$router.push({ path: `/recipe/${this.recipeId}/step` })
     }
   }
 }

+ 7 - 5
src/views/recipe/step.vue

@@ -1,13 +1,12 @@
 <template>
   <div class="app-container">
     <div class="filter-container">
-      <el-button
-        class="filter-item"
-        type="primary"
-        @click="handleCreateOrUpdate('create')"
-      >
+      <el-button class="filter-item" type="primary" @click="handleCreateOrUpdate('create')">
         添加
       </el-button>
+      <el-button class="filter-item" type="primary" @click="toFood()">
+        食物管理
+      </el-button>
     </div>
     <el-table
       ref="dragTable"
@@ -170,6 +169,9 @@ export default {
         onEnd: evt => {
         }
       })
+    },
+    toFood() {
+      this.$router.push({ path: `/recipe/${this.recipeId}/food` })
     }
   }
 }