Skip to content

Commit

Permalink
feat(popover): add slots type (tusen-ai#6599)
Browse files Browse the repository at this point in the history
  • Loading branch information
nailiable committed Dec 7, 2024
1 parent d06255f commit 0db42a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/popover/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type { PopoverInst, PopoverTrigger } from './src/interface'
export { default as NPopover, popoverProps } from './src/Popover'
export type { PopoverProps } from './src/Popover'
export type { PopoverProps, PopoverSlots } from './src/Popover'
export type { FollowerPlacement as PopoverPlacement } from 'vueuc'
10 changes: 10 additions & 0 deletions src/popover/src/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
provide,
type Ref,
ref,
type SlotsType,
Text,
toRef,
type VNode,
Expand Down Expand Up @@ -222,10 +223,19 @@ export const popoverProps = {
export type PopoverProps = ExtractPublicPropTypes<typeof popoverBaseProps>
export type PopoverInternalProps = ExtractInternalPropTypes<typeof popoverProps>

export interface PopoverSlots {
trigger?: any
footer?: any
header?: any
default?: any
[key: string]: any
}

export default defineComponent({
name: 'Popover',
inheritAttrs: false,
props: popoverProps,
slots: Object as SlotsType<PopoverSlots>,
__popover__: true,
setup(props) {
if (__DEV__) {
Expand Down

0 comments on commit 0db42a8

Please sign in to comment.