Skip to content

Commit

Permalink
feat(select): 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 6fd2272 commit 1d69061
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/select/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export type {
SelectOption
} from './src/interface'
export { default as NSelect, selectProps } from './src/Select'
export type { SelectProps } from './src/Select'
export type { SelectProps, SelectSlots } from './src/Select'
10 changes: 10 additions & 0 deletions src/select/src/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
type InputHTMLAttributes,
type PropType,
ref,
type SlotsType,
toRef,
Transition,
vShow,
Expand Down Expand Up @@ -217,9 +218,18 @@ export const selectProps = {

export type SelectProps = ExtractPublicPropTypes<typeof selectProps>

export interface SelectSlots {
default?: any
header?: any
action?: any
empty?: any
arrow?: any
}

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

0 comments on commit 1d69061

Please sign in to comment.