@@ -186,7 +186,16 @@ export function updateProps(
186186 // and converted to camelCase (#955)
187187 ( ( kebabKey = hyphenate ( key ) ) === key || ! hasOwn ( rawProps , kebabKey ) ) )
188188 ) {
189- delete props [ key ]
189+ if ( options ) {
190+ props [ key ] = resolvePropValue (
191+ options ,
192+ rawProps || EMPTY_OBJ ,
193+ key ,
194+ undefined
195+ )
196+ } else {
197+ delete props [ key ]
198+ }
190199 }
191200 }
192201 for ( const key in attrs ) {
@@ -250,25 +259,24 @@ function resolvePropValue(
250259 key : string ,
251260 value : unknown
252261) {
253- let opt = options [ key ]
254- if ( opt == null ) {
255- return value
256- }
257- const hasDefault = hasOwn ( opt , 'default' )
258- // default values
259- if ( hasDefault && value === undefined ) {
260- const defaultValue = opt . default
261- value = isFunction ( defaultValue ) ? defaultValue ( ) : defaultValue
262- }
263- // boolean casting
264- if ( opt [ BooleanFlags . shouldCast ] ) {
265- if ( ! hasOwn ( props , key ) && ! hasDefault ) {
266- value = false
267- } else if (
268- opt [ BooleanFlags . shouldCastTrue ] &&
269- ( value === '' || value === hyphenate ( key ) )
270- ) {
271- value = true
262+ const opt = options [ key ]
263+ if ( opt != null ) {
264+ const hasDefault = hasOwn ( opt , 'default' )
265+ // default values
266+ if ( hasDefault && value === undefined ) {
267+ const defaultValue = opt . default
268+ value = isFunction ( defaultValue ) ? defaultValue ( ) : defaultValue
269+ }
270+ // boolean casting
271+ if ( opt [ BooleanFlags . shouldCast ] ) {
272+ if ( ! hasOwn ( props , key ) && ! hasDefault ) {
273+ value = false
274+ } else if (
275+ opt [ BooleanFlags . shouldCastTrue ] &&
276+ ( value === '' || value === hyphenate ( key ) )
277+ ) {
278+ value = true
279+ }
272280 }
273281 }
274282 return value
0 commit comments