Skip to content

Commit f69dbab

Browse files
fix(compiler-sfc): fix props destructing default value type checking with unresolved type (#8340)
close #8326
1 parent 216f269 commit f69dbab

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,7 @@ function genDestructuredDefaultValue(
311311
const value = ctx.getString(defaultVal)
312312
const unwrapped = unwrapTSNode(defaultVal)
313313

314-
if (
315-
inferredType &&
316-
inferredType.length &&
317-
!inferredType.includes(UNKNOWN_TYPE)
318-
) {
314+
if (inferredType && inferredType.length && !inferredType.includes('null')) {
319315
const valueType = inferValueType(unwrapped)
320316
if (valueType && !inferredType.includes(valueType)) {
321317
ctx.error(

0 commit comments

Comments
 (0)