Skip to content

Commit

Permalink
fix(compiler-sfc): props destructing default value type checking with…
Browse files Browse the repository at this point in the history
… unresolved type (vuejs#8326)
  • Loading branch information
kalvenschraut committed May 16, 2023
1 parent a374d7e commit 2760dba
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/compiler-sfc/src/script/defineProps.ts
Expand Up @@ -311,11 +311,7 @@ function genDestructuredDefaultValue(
const value = ctx.getString(defaultVal)
const unwrapped = unwrapTSNode(defaultVal)

if (
inferredType &&
inferredType.length &&
!inferredType.includes(UNKNOWN_TYPE)
) {
if (inferredType && inferredType.length && !inferredType.includes('null')) {
const valueType = inferValueType(unwrapped)
if (valueType && !inferredType.includes(valueType)) {
ctx.error(
Expand Down

0 comments on commit 2760dba

Please sign in to comment.