feat:新增 tagview 导航页

This commit is contained in:
JaguarJack
2024-03-23 17:21:39 +08:00
parent c3eb2443b6
commit b81b9b66c8
10 changed files with 236 additions and 17 deletions

View File

@@ -14,8 +14,25 @@
</template>
<script lang="ts" setup>
import { useAppStore } from '/admin/stores/modules/app'
import { watch } from 'vue'
import router from '/admin/router'
import { useNavTabStore } from '/admin/stores/modules/tabs'
const appStore = useAppStore()
const navTabStore = useNavTabStore()
watch(() => router.currentRoute, (to, from) => {
const tab: any = {
name: to.value.name,
fullPath: to.value.fullPath,
path: to.value.path,
is_active: true,
meta: {
title: to.value.meta.title,
affix: false,
}
}
navTabStore.addTabs(tab)
}, {deep:true, immediate:true})
</script>
<style scoped lang="scss">