refactor: drop event delegation and use simple async edge case fix

This commit is contained in:
Evan You
2019-01-22 16:03:37 -05:00
parent 9449dfb352
commit 360a10fff2
6 changed files with 48 additions and 148 deletions

View File

@@ -1,8 +1,5 @@
import { isString } from '@vue/shared'
// style properties that should NOT have "px" added when numeric
const nonNumericRE = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i
export function patchStyle(el: any, prev: any, next: any, data: any) {
const { style } = el
if (!next) {
@@ -11,11 +8,7 @@ export function patchStyle(el: any, prev: any, next: any, data: any) {
style.cssText = next
} else {
for (const key in next) {
let value = next[key]
if (typeof value === 'number' && !nonNumericRE.test(key)) {
value = value + 'px'
}
style[key] = value
style[key] = next[key]
}
if (prev && !isString(prev)) {
for (const key in prev) {