From 0d508e9f51734409ac1aa57ba0ea98808be0a3a3 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 18 Aug 2020 10:52:50 -0400 Subject: [PATCH] feat(runtime-core): pass current props to prop default value functions close #1886 --- packages/runtime-core/src/componentProps.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime-core/src/componentProps.ts b/packages/runtime-core/src/componentProps.ts index 96b365b5..fcf707e0 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