]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(compiler-sfc): fix props destructing default value type checking with unresolved...
authorKalven Schraut <30308012+kalvenschraut@users.noreply.github.com>
Wed, 17 May 2023 01:59:49 +0000 (20:59 -0500)
committerGitHub <noreply@github.com>
Wed, 17 May 2023 01:59:49 +0000 (09:59 +0800)
close #8326

packages/compiler-sfc/src/script/defineProps.ts

index be99c6122ec2ec76765c3bc35825faec9565e420..1ae5a16e3d67fe2674171d22f29df299e72bc759 100644 (file)
@@ -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(