Skip to content

Commit

Permalink
feat(color-picker): 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 e3ab2bb commit 5df707c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/color-picker/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { colorPickerProps, default as NColorPicker } from './src/ColorPicker'
export type { ColorPickerProps } from './src/ColorPicker'
export type { ColorPickerProps, ColorPickerSlots } from './src/ColorPicker'
8 changes: 8 additions & 0 deletions src/color-picker/src/ColorPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {
provide,
type Ref,
ref,
type SlotsType,
toRef,
Transition,
type VNode,
Expand Down Expand Up @@ -124,9 +125,16 @@ export const colorPickerProps = {

export type ColorPickerProps = ExtractPublicPropTypes<typeof colorPickerProps>

export interface ColorPickerSlots {
default?: any
label?: (color: string | null) => any
action?: any
}

export default defineComponent({
name: 'ColorPicker',
props: colorPickerProps,
slots: Object as SlotsType<ColorPickerSlots>,
setup(props, { slots }) {
const selfRef = ref<HTMLElement | null>(null)
let upcomingValue: string | null = null
Expand Down

0 comments on commit 5df707c

Please sign in to comment.