feat(runtime-core): pass current props to prop default value functions

close #1886
This commit is contained in:
Evan You 2020-08-18 10:52:50 -04:00
parent d005b578b1
commit 0d508e9f51

View File

@ -291,7 +291,7 @@ function resolvePropValue(
const defaultValue = opt.default
value =
opt.type !== Function && isFunction(defaultValue)
? defaultValue()
? defaultValue(props)
: defaultValue
}
// boolean casting