From: Evan You Date: Tue, 18 Aug 2020 14:52:50 +0000 (-0400) Subject: feat(runtime-core): pass current props to prop default value functions X-Git-Tag: v3.0.0-rc.6~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d508e9f51734409ac1aa57ba0ea98808be0a3a3;p=thirdparty%2Fvuejs%2Fcore.git feat(runtime-core): pass current props to prop default value functions close #1886 --- diff --git a/packages/runtime-core/src/componentProps.ts b/packages/runtime-core/src/componentProps.ts index 96b365b50e..fcf707e021 100644 --- a/packages/runtime-core/src/componentProps.ts +++ b/packages/runtime-core/src/componentProps.ts @@ -291,7 +291,7 @@ function resolvePropValue( const defaultValue = opt.default value = opt.type !== Function && isFunction(defaultValue) - ? defaultValue() + ? defaultValue(props) : defaultValue } // boolean casting