Browse Source

modal tab

master
maochaoying 2 years ago
parent
commit
db2fdf817d
  1. 4
      src/components/Tabs.vue
  2. 4
      src/store/modules/tab.js

4
src/components/Tabs.vue

@ -104,15 +104,17 @@ const ejectModalVisible = ref(false)
const handleModalVisible = () => {
ejectModalVisible.value = false
changeTab(1)
tabStore.updateActiveTab(tabStore.preActiveTab)
}
const changeTab = index => {
tabStore.updateActiveTab(index)
if (index == 1) {
router.push('/')
tabStore.updatePreActiveTab(1)
}
if (index == 2) {
router.push('/test')
tabStore.updatePreActiveTab(2)
}
if (index == 3) {
ejectModalVisible.value = true

4
src/store/modules/tab.js

@ -7,10 +7,14 @@ export const useTabStore = defineStore({
return {
activeStep: 1,
activeTab: 1,
preActiveTab: 1,
}
},
// actions
actions: {
updatePreActiveTab(preActiveTab) {
this.preActiveTab = preActiveTab
},
updateActiveStep(activeStep) {
this.activeStep = activeStep
},

Loading…
Cancel
Save