mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(DatetimePicker): error in some edge cases (#10140)
This commit is contained in:
parent
0b12b45d69
commit
f63ea390b6
@ -18,9 +18,13 @@ export const pickerInheritKeys = Object.keys(pickerSharedProps) as Array<
|
|||||||
>;
|
>;
|
||||||
|
|
||||||
export function times<T>(n: number, iteratee: (index: number) => T) {
|
export function times<T>(n: number, iteratee: (index: number) => T) {
|
||||||
let index = -1;
|
if (n < 0) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
const result: T[] = Array(n);
|
const result: T[] = Array(n);
|
||||||
|
|
||||||
|
let index = -1;
|
||||||
while (++index < n) {
|
while (++index < n) {
|
||||||
result[index] = iteratee(index);
|
result[index] = iteratee(index);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user