feat(TagsView): Add TagsView component

feat(ContextMenu): Add ContextMenu component

feat(store): Add tagsView store
This commit is contained in:
kailong321200875
2022-01-16 17:55:20 +08:00
parent 4612e5544b
commit 349ac9d398
20 changed files with 900 additions and 164 deletions

View File

@@ -1,6 +1,5 @@
<script lang="tsx">
import { computed, defineComponent, KeepAlive } from 'vue'
import { useTagsViewStore } from '@/store/modules/tagsView'
import { computed, defineComponent } from 'vue'
import { useAppStore } from '@/store/modules/app'
import { Menu } from '@/components/Menu'
import { Collapse } from '@/components/Collapse'
@@ -10,12 +9,7 @@ import { UserInfo } from '@/components/UserInfo'
import { Screenfull } from '@/components/Screenfull'
import { Breadcrumb } from '@/components/Breadcrumb'
import { TagsView } from '@/components/TagsView'
const tagsViewStore = useTagsViewStore()
const getCaches = computed((): string[] => {
return tagsViewStore.getCachedViews
})
import AppView from './components/AppView.vue'
const appStore = useAppStore()
@@ -71,18 +65,10 @@ export default defineComponent({
<UserInfo class="header__tigger"></UserInfo>
</div>
</div>
<div class="v-app-right__tags relative">
<div class="v-app-right__tags-view relative">
<TagsView></TagsView>
</div>
<router-view>
{{
default: ({ Component, route }) => (
<KeepAlive include={getCaches.value}>
<Component is={Component} key={route.fullPath}></Component>
</KeepAlive>
)
}}
</router-view>
<AppView></AppView>
</div>
</section>
)
@@ -111,7 +97,7 @@ export default defineComponent({
transition: left var(--transition-time-02);
&__tool,
&__tags {
&__tags-view {
&::after {
position: absolute;
bottom: 0;

View File

@@ -0,0 +1,20 @@
<script setup lang="ts">
import { useTagsViewStore } from '@/store/modules/tagsView'
import { computed } from 'vue'
const tagsViewStore = useTagsViewStore()
const getCaches = computed((): string[] => {
return tagsViewStore.getCachedViews
})
</script>
<template>
<router-view>
<template #default="{ Component, route }">
<keep-alive :include="getCaches">
<component :is="Component" :key="route.fullPath" />
</keep-alive>
</template>
</router-view>
</template>