@@ -186,7 +186,16 @@ export function updateProps(
186
186
// and converted to camelCase (#955)
187
187
( ( kebabKey = hyphenate ( key ) ) === key || ! hasOwn ( rawProps , kebabKey ) ) )
188
188
) {
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
+ }
190
199
}
191
200
}
192
201
for ( const key in attrs ) {
@@ -250,25 +259,24 @@ function resolvePropValue(
250
259
key : string ,
251
260
value : unknown
252
261
) {
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
+ }
272
280
}
273
281
}
274
282
return value
0 commit comments