diff --git a/packages/runtime-core/src/componentProps.ts b/packages/runtime-core/src/componentProps.ts index 3ea727dd..476fba88 100644 --- a/packages/runtime-core/src/componentProps.ts +++ b/packages/runtime-core/src/componentProps.ts @@ -456,11 +456,7 @@ function getTypeIndex( expectedTypes: PropType | void | null | true ): number { if (isArray(expectedTypes)) { - for (let i = 0, len = expectedTypes.length; i < len; i++) { - if (isSameType(expectedTypes[i], type)) { - return i - } - } + return expectedTypes.findIndex(t => isSameType(t, type)) } else if (isFunction(expectedTypes)) { return isSameType(expectedTypes, type) ? 0 : -1 }