fix(runtime-dom): should not coerce nullish values to empty strings for non-string dom props
fix #1049 close #1092, close #1093, close #1094
This commit is contained in:
@@ -31,7 +31,10 @@ export function patchDOMProp(
|
||||
if (value === '' && typeof el[key] === 'boolean') {
|
||||
// e.g. <select multiple> compiles to { multiple: '' }
|
||||
el[key] = true
|
||||
} else if (value == null && typeof el[key] === 'string') {
|
||||
// e.g. <div :id="null">
|
||||
el[key] = ''
|
||||
} else {
|
||||
el[key] = value == null ? '' : value
|
||||
el[key] = value
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user