File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ const isProfileShow = ref(false)
4141 ],
4242 ]" class =" flex-center"
4343 >
44- <template #label >
44+ <template #header >
4545 <div class =" space-y-2" >
4646 <div class =" text-xs text-secondary-foreground/50 font-light" >
4747 当前登录账号
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ const props = defineProps<{
3131
3232const slots = defineSlots <{
3333 default? : () => VNode
34- label? : () => VNode
34+ header? : () => VNode
35+ footer? : () => VNode
3536}>()
3637
3738const myItems = computed (() => {
@@ -55,9 +56,9 @@ function handleItemClick(item: { handle?: () => void }) {
5556 <slot />
5657 </DropdownMenuTrigger >
5758 <DropdownMenuContent :align :align-offset :side :side-offset :collision-padding >
58- <template v-if =" !! slots .label " >
59+ <template v-if =" !! slots .header " >
5960 <DropdownMenuLabel >
60- <slot name =" label " />
61+ <slot name =" header " />
6162 </DropdownMenuLabel >
6263 <DropdownMenuSeparator />
6364 </template >
@@ -72,6 +73,12 @@ function handleItemClick(item: { handle?: () => void }) {
7273 </DropdownMenuGroup >
7374 <DropdownMenuSeparator v-if =" index !== myItems.length - 1" />
7475 </template >
76+ <template v-if =" !! slots .footer " >
77+ <DropdownMenuSeparator />
78+ <DropdownMenuLabel >
79+ <slot name =" footer" />
80+ </DropdownMenuLabel >
81+ </template >
7582 </DropdownMenuContent >
7683 </DropdownMenu >
7784</template >
You can’t perform that action at this time.
0 commit comments