Skip to content

Commit 42b6e70

Browse files
authored
fix(PinInput): default value type (#2311)
Should be string[] not string[][]
1 parent 7496669 commit 42b6e70

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/core/src/PinInput/PinInputRoot.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export type PinInputType = 'text' | 'number'
1313
export type PinInputValue<Type extends PinInputType> = [Type] extends ['number'] ? number[] : string[]
1414
1515
// provide the mixed arrays because the `type` is dynamic in the context
16-
export type PinInputContextValue<Type extends PinInputType = 'text'> =
17-
Type extends 'number'
16+
export type PinInputContextValue<Type extends PinInputType = 'text'>
17+
= Type extends 'number'
1818
? Type extends 'string'
1919
? string[] | number[]
2020
: number[]
@@ -29,7 +29,7 @@ export interface PinInputRootProps<Type extends PinInputType = 'text'> extends P
2929
/** The controlled checked state of the pin input. Can be binded as `v-model`. */
3030
modelValue?: PinInputValue<Type> | null
3131
/** The default value of the pin inputs when it is initially rendered. Use when you do not need to control its checked state. */
32-
defaultValue?: PinInputValue<Type>[]
32+
defaultValue?: PinInputValue<Type>
3333
/** The placeholder character to use for empty pin-inputs. */
3434
placeholder?: string
3535
/** When `true`, pin inputs will be treated as password. */

0 commit comments

Comments
 (0)