File tree Expand file tree Collapse file tree 3 files changed +62
-3
lines changed
layouts/components/MainSidebar
ui/components/FaButtonGroup Expand file tree Collapse file tree 3 files changed +62
-3
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ onUnmounted(() => {
4040 <component :is =" useSlots('main-sidebar-top')" />
4141 <Logo :show-title =" false" class =" sidebar-logo" />
4242 <component :is =" useSlots('main-sidebar-after-logo')" />
43- <FaScrollArea :scrollbar =" false" mask gradient-color =" var(--g-main-sidebar-bg)" class =" menu" >
43+ <FaScrollArea :scrollbar =" false" mask gradient-color =" var(--g-main-sidebar-bg)" class =" menu flex-1 " >
4444 <!-- 侧边栏模式(含主导航) -->
4545 <div class =" w-full flex flex-col of-hidden py-1 transition-all -mt-2" >
4646 <template v-for =" (item , index ) in menuStore .allMenus " :key =" index " >
@@ -92,8 +92,6 @@ onUnmounted(() => {
9292 }
9393
9494 .menu {
95- flex : 1 ;
96-
9795 :deep(.menu-item) {
9896 .menu-item-container {
9997 padding-block : 8px ;
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ declare module 'vue' {
1313 FaAvatar : typeof import ( './../ui/components/FaAvatar/index.vue' ) [ 'default' ]
1414 FaBackToTop : typeof import ( './../ui/components/FaBackToTop/index.vue' ) [ 'default' ]
1515 FaButton : typeof import ( './../ui/components/FaButton/index.vue' ) [ 'default' ]
16+ FaButtonGroup : typeof import ( './../ui/components/FaButtonGroup/index.vue' ) [ 'default' ]
1617 FaCard : typeof import ( './../ui/components/FaCard/index.vue' ) [ 'default' ]
1718 FaCheckbox : typeof import ( './../ui/components/FaCheckbox/index.vue' ) [ 'default' ]
1819 FaContextMenu : typeof import ( './../ui/components/FaContextMenu/index.vue' ) [ 'default' ]
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import { cn } from ' @/utils'
3+
4+ defineOptions ({
5+ name: ' FaButtonGroup' ,
6+ })
7+
8+ const props = defineProps <{
9+ vertical? : boolean
10+ }>()
11+ </script >
12+
13+ <template >
14+ <div
15+ :class =" cn('inline-flex gap-[1px] items-stretch', {
16+ 'horizontal-group flex-row': !props.vertical,
17+ 'vertical-group flex-col': props.vertical,
18+ })"
19+ >
20+ <slot />
21+ </div >
22+ </template >
23+
24+ <style scoped>
25+ .horizontal-group {
26+ :deep(> button) {
27+ &:first-child {
28+ border-top-right-radius: 0 ;
29+ border-bottom-right-radius : 0 ;
30+ }
31+
32+ &:last-child {
33+ border-top-left-radius : 0 ;
34+ border-bottom-left-radius : 0 ;
35+ }
36+
37+ &:not (:first-child , :last-child ) {
38+ border-radius : 0 ;
39+ }
40+ }
41+ }
42+
43+ .vertical-group {
44+ :deep(> button) {
45+ &:first-child {
46+ border-bottom-right-radius: 0 ;
47+ border-bottom-left-radius : 0 ;
48+ }
49+
50+ &:last-child {
51+ border-top-left-radius : 0 ;
52+ border-top-right-radius : 0 ;
53+ }
54+
55+ &:not (:first-child , :last-child ) {
56+ border-radius : 0 ;
57+ }
58+ }
59+ }
60+ </style >
You can’t perform that action at this time.
0 commit comments