Skip to content

Commit 0d508e9

Browse files
committed
feat(runtime-core): pass current props to prop default value functions
close #1886
1 parent d005b57 commit 0d508e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/runtime-core/src/componentProps.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ function resolvePropValue(
291291
const defaultValue = opt.default
292292
value =
293293
opt.type !== Function && isFunction(defaultValue)
294-
? defaultValue()
294+
? defaultValue(props)
295295
: defaultValue
296296
}
297297
// boolean casting

0 commit comments

Comments
 (0)