Skip to content

Commit

Permalink
feat(input-number): 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 0c1b522 commit 83d9bc5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/input-number/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { inputNumberProps, default as NInputNumber } from './src/InputNumber'
export type { InputNumberProps } from './src/InputNumber'
export type { InputNumberProps, InputNumberSlots } from './src/InputNumber'
export type { InputNumberInst } from './src/interface'
9 changes: 9 additions & 0 deletions src/input-number/src/InputNumber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
nextTick,
type PropType,
ref,
type SlotsType,
toRef,
type VNode,
watch,
Expand Down Expand Up @@ -110,9 +111,17 @@ export const inputNumberProps = {

export type InputNumberProps = ExtractPublicPropTypes<typeof inputNumberProps>

export interface InputNumberSlots {
'add-icon'?: any
'minus-icon'?: any
prefix?: any
suffix?: any
}

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

0 comments on commit 83d9bc5

Please sign in to comment.