chenrui 3 vuotta sitten
vanhempi
commit
68a849dc9c

+ 1 - 1
src/components/MultiTab/MultiTab.vue

@@ -48,7 +48,7 @@ export default {
       const index = this.tabsList.indexOf(targetKey)
       if (index >= 0) {
         const row = this.pages[index]
-        if (row && row.fullPath && row.fullPath.indexOf('/list') == -1) { // 非列表页
+        if (row && row.fullPath && row.fullPath.indexOf('/list') == -1) { // 非列表页,根据当前路由路径判断是子页还是列表页
           this.$store.state.app.isNewSubTab = true
         } else {
           this.$store.state.app.isNewSubTab = false

+ 3 - 3
src/views/productManagement/newProduct/detail.vue

@@ -58,7 +58,7 @@ export default {
     return {
       itemId: null,
       detailsData: null, //  详情数据
-      pageInfo: null
+      prevPageInfo: null
     }
   },
   methods: {
@@ -75,7 +75,7 @@ export default {
     },
     // 返回
     goBack () {
-      this.$router.push({ path: this.pageInfo && this.pageInfo.path, query: { closeLastOldTab: true } })
+      this.$router.push({ path: this.prevPageInfo && this.prevPageInfo.path, query: { closeLastOldTab: true } })
     }
   },
   mounted () {
@@ -93,7 +93,7 @@ export default {
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.pageInfo = from
+      vm.prevPageInfo = from
     })
   }
 }