wip: refactor attrs inheritance

This commit is contained in:
Evan You
2018-09-24 18:51:58 -04:00
parent ef1d621162
commit 85cd69a988
7 changed files with 94 additions and 76 deletions

View File

@@ -22,13 +22,13 @@ export function patchStyle(el: any, prev: any, next: any, data: any) {
if (typeof value === 'number' && !nonNumericRE.test(key)) {
value = value + 'px'
}
style.setProperty(key, value)
style[key] = value
}
if (prev && typeof prev !== 'string') {
prev = normalizeStyle(prev)
for (const key in prev) {
if (!normalizedNext[key]) {
style.setProperty(key, '')
style[key] = ''
}
}
}