diff --git a/packages/vant/src/date-picker/demo/index.vue b/packages/vant/src/date-picker/demo/index.vue index 5b4dd2127..dd3f7b1d6 100644 --- a/packages/vant/src/date-picker/demo/index.vue +++ b/packages/vant/src/date-picker/demo/index.vue @@ -1,7 +1,7 @@ diff --git a/packages/vant/src/picker/types.ts b/packages/vant/src/picker/types.ts index 91f98c329..e3e57318c 100644 --- a/packages/vant/src/picker/types.ts +++ b/packages/vant/src/picker/types.ts @@ -45,7 +45,7 @@ export type PickerColumnProvide = { export type PickerInstance = ComponentPublicInstance; export type PickerConfirmEventParams = { - selectedValues: Array; + selectedValues: Numeric[]; selectedOptions: Array; }; diff --git a/packages/vant/src/picker/utils.ts b/packages/vant/src/picker/utils.ts index 2e4bb6537..56df46434 100644 --- a/packages/vant/src/picker/utils.ts +++ b/packages/vant/src/picker/utils.ts @@ -1,4 +1,4 @@ -import { isDef, clamp, extend } from '../utils'; +import { isDef, clamp, extend, type Numeric } from '../utils'; import type { Ref } from 'vue'; import type { PickerOption, PickerColumn, PickerFieldNames } from './types'; @@ -41,7 +41,7 @@ export function findIndexOfEnabledOption( export const isOptionExist = ( options: PickerOption[], - value: number | string | undefined, + value: Numeric | undefined, fields: Required ) => value !== undefined && @@ -49,7 +49,7 @@ export const isOptionExist = ( export function findOptionByValue( options: PickerOption[], - value: number | string, + value: Numeric, fields: Required ): PickerOption | undefined { const index = options.findIndex((option) => option[fields.value] === value); @@ -60,7 +60,7 @@ export function findOptionByValue( export function formatCascadeColumns( columns: PickerColumn | PickerColumn[], fields: Required, - selectedValues: Ref> + selectedValues: Ref ) { const formatted: PickerColumn[] = []; diff --git a/packages/vant/src/time-picker/demo/index.vue b/packages/vant/src/time-picker/demo/index.vue index 9653b352c..69bb059a9 100644 --- a/packages/vant/src/time-picker/demo/index.vue +++ b/packages/vant/src/time-picker/demo/index.vue @@ -1,9 +1,9 @@