Skip to content

Commit

Permalink
feat(tree): export 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 90624f1 commit 45366cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/tree/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export type {
TreeOverrideNodeClickBehaviorReturn
} from './src/interface'
export { default as NTree, treeProps } from './src/Tree'
export type { TreeProps } from './src/Tree'
export type { TreeProps, TreeSlots } from './src/Tree'
export { treeGetClickTarget } from './src/utils'
7 changes: 7 additions & 0 deletions src/tree/src/Tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
type PropType,
provide,
ref,
type SlotsType,
toRef,
type VNode,
type VNodeChild,
Expand Down Expand Up @@ -348,9 +349,15 @@ export const treeProps = {

export type TreeProps = ExtractPublicPropTypes<typeof treeProps>

export interface TreeSlots {
default?: any
empty?: any
}

export default defineComponent({
name: 'Tree',
props: treeProps,
slots: Object as SlotsType<TreeSlots>,
setup(props) {
if (__DEV__) {
watchEffect(() => {
Expand Down

0 comments on commit 45366cb

Please sign in to comment.