Skip to content

Commit

Permalink
✨ 为菜单栏的 tab 栏新增横向滑动
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyomotoi committed Oct 31, 2024
1 parent 1d8fe23 commit b84d5a0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions frontend/src/components/header/TabBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ const operation = (route: NavItem) => {
</script>

<template>
<div role="tablist" class="tabs tabs-lifted justify-start">
<div role="tablist" class="tabs tabs-lifted justify-start overflow-x-auto !flex">
<TransitionGroup>
<a
v-for="(i, index) in store.viewHistory"
:key="i.name"
role="tab"
:class="{
'tab flex gap-2 hover:bg-primary/[.2] transition !border-b-0': true,
'tab flex gap-2 hover:bg-primary/[.2] transition !border-b-0 shrink-0': true,
'[--tab-bg:oklch(var(--b2))] tab-active': isCurrentRoute(i.routeData.path)
}"
@click="operation(i)"
Expand Down Expand Up @@ -88,4 +88,8 @@ const operation = (route: NavItem) => {
.tabs-lifted > .tab:is(input:checked):before {
z-index: 0;
}
.tabs::-webkit-scrollbar {
display: none;
}
</style>

0 comments on commit b84d5a0

Please sign in to comment.