Browse Source

添加分类返回后清除tagsView

e 5 năm trước cách đây
mục cha
commit
ab599eb976
2 tập tin đã thay đổi với 4 bổ sung12 xóa
  1. 2 6
      src/views/goods/category-create.vue
  2. 2 6
      src/views/goods/category-edit.vue

+ 2 - 6
src/views/goods/category-create.vue

@@ -44,9 +44,7 @@
         </el-select>
       </el-form-item>
       <el-form-item>
-        <router-link :to="{path:'/goods/category'}">
-          <el-button type="primary" plain style="margin-right:10px">返回</el-button>
-        </router-link>
+        <el-button type="primary" plain style="margin-right:10px" @click="backToList">返回</el-button>
         <el-button type="primary" @click="updateData">提交</el-button>
       </el-form-item>
     </el-form>
@@ -107,9 +105,7 @@ export default {
               type: response.code * 1 === 1 ? 'success' : 'error',
               duration: 2000
             })
-            setTimeout(() => {
-              this.$router.push({ path: '/goods/category' })
-            }, 2000)
+            this.backToList()
           })
         }
       })

+ 2 - 6
src/views/goods/category-edit.vue

@@ -44,9 +44,7 @@
         </el-select>
       </el-form-item>
       <el-form-item>
-        <router-link :to="{path:'/goods/category'}">
-          <el-button type="primary" plain style="margin-right:10px">返回</el-button>
-        </router-link>
+        <el-button type="primary" plain style="margin-right:10px" @click="backToList">返回</el-button>
         <el-button type="primary" @click="updateData">提交</el-button>
       </el-form-item>
     </el-form>
@@ -118,9 +116,7 @@ export default {
               type: response.code * 1 === 1 ? 'success' : 'error',
               duration: 2000
             })
-            setTimeout(() => {
-              this.$router.push({ path: '/goods/category' })
-            }, 2000)
+            this.backToList()
           })
         }
       })