From f61a3ff9805da8d1c3f175b4c95a6c2a77442664 Mon Sep 17 00:00:00 2001 From: Yjhon Date: Wed, 30 Mar 2022 10:58:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E9=A1=B9=E7=9B=AE=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/project/ProjectStepForm.vue | 15 +++++++++------ src/views/project/form/ProjectCourseList.vue | 2 +- src/views/project/form/ProjectPersonForm.vue | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/views/project/ProjectStepForm.vue b/src/views/project/ProjectStepForm.vue index 5326d2d..54030b4 100644 --- a/src/views/project/ProjectStepForm.vue +++ b/src/views/project/ProjectStepForm.vue @@ -59,6 +59,7 @@ export default { }, //生命周期 - 销毁完成 data() { return { + path: [], title: '', currentTab: 0, currentTab: 0, @@ -120,6 +121,9 @@ export default { //下一步 nextStep(childValue, beChange) { console.log('进入下一步', childValue, beChange) + + //缓存当前步骤,用于上一步时往回跳tab + this.path.push(this.currentTab); if (beChange) { this.courseChange = beChange } @@ -134,11 +138,12 @@ export default { } } console.log('currentTab key:', this.$refs.steps.$slots.default) - console.log('currentTab:', this.currentTab, 'currentTab:', this.currentTab) + console.log('currentTab:', this.currentTab, 'path:', this.path) console.log('ProjectStepForm表单数据', this.form) }, //上一步 prevStep(childValue, beChange) { + if (beChange) { this.courseChange = beChange } @@ -147,11 +152,9 @@ export default { if (childValue) { this.form = childValue } - if (this.form.projectType == 0 && this.currentTab == 2) { - this.currentTab = 1 - } else { - this.currentTab -= 1 - } + //跳到上一个tab页,剔除最后一个页码 + let tab = this.path.pop(); + this.currentTab = tab; } console.log('currentTab:', this.currentTab, 'currentTab:', this.currentTab) console.log('ProjectStepForm表单数据', this.form) diff --git a/src/views/project/form/ProjectCourseList.vue b/src/views/project/form/ProjectCourseList.vue index be7b135..1ed49c7 100644 --- a/src/views/project/form/ProjectCourseList.vue +++ b/src/views/project/form/ProjectCourseList.vue @@ -45,7 +45,7 @@ 上一步 下一步 保存 - 发布 + 发布 diff --git a/src/views/project/form/ProjectPersonForm.vue b/src/views/project/form/ProjectPersonForm.vue index 2a012bd..8b45cee 100644 --- a/src/views/project/form/ProjectPersonForm.vue +++ b/src/views/project/form/ProjectPersonForm.vue @@ -59,7 +59,7 @@ 上一步 下一步 保存 - 发布 + 发布