style(TagView): Vertical center tag

This commit is contained in:
kailong321200875 2022-01-16 18:05:51 +08:00
parent 349ac9d398
commit 41281c4d54
1 changed files with 4 additions and 2 deletions

View File

@ -86,6 +86,7 @@ const closeRightTags = () => {
tagsViewStore.delRightViews(unref(selectedTag) as RouteLocationNormalizedLoaded) tagsViewStore.delRightViews(unref(selectedTag) as RouteLocationNormalizedLoaded)
} }
//
const toLastView = () => { const toLastView = () => {
const visitedViews = tagsViewStore.getVisitedViews const visitedViews = tagsViewStore.getVisitedViews
const latestView = visitedViews.slice(-1)[0] const latestView = visitedViews.slice(-1)[0]
@ -104,6 +105,7 @@ const toLastView = () => {
} }
} }
// tag
const isActive = (route: RouteLocationNormalizedLoaded): boolean => { const isActive = (route: RouteLocationNormalizedLoaded): boolean => {
return route.path === unref(currentRoute).path return route.path === unref(currentRoute).path
} }
@ -198,7 +200,7 @@ watch(
]" ]"
> >
<router-link :to="{ ...item }" custom #default="{ navigate }"> <router-link :to="{ ...item }" custom #default="{ navigate }">
<div @click="navigate" class="h-full"> <div @click="navigate" class="h-full flex justify-center items-center">
{{ t(item?.meta?.title as string) }} {{ t(item?.meta?.title as string) }}
<Icon <Icon
class="v-tags-view__item--close" class="v-tags-view__item--close"
@ -311,7 +313,7 @@ watch(
&__item { &__item {
position: relative; position: relative;
top: 1px; top: 2px;
height: calc(~'100% - 4px'); height: calc(~'100% - 4px');
padding: 0 15px; padding: 0 15px;
font-size: 12px; font-size: 12px;