mirror of
https://github.com/vuejs/vue.git
synced 2024-11-22 04:39:46 +00:00
parent
d6468c4c38
commit
f5ef882a78
@ -91,10 +91,8 @@ function updateStyle(oldVnode: VNodeWithData, vnode: VNodeWithData) {
|
|||||||
}
|
}
|
||||||
for (name in newStyle) {
|
for (name in newStyle) {
|
||||||
cur = newStyle[name]
|
cur = newStyle[name]
|
||||||
if (cur !== oldStyle[name]) {
|
// ie9 setting to null has no effect, must use empty string
|
||||||
// ie9 setting to null has no effect, must use empty string
|
setProp(el, name, cur == null ? '' : cur)
|
||||||
setProp(el, name, cur == null ? '' : cur)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,4 +36,19 @@ describe('vdom style module', () => {
|
|||||||
expect(elm.style.fontSize).toBe('')
|
expect(elm.style.fontSize).toBe('')
|
||||||
expect(elm.style.display).toBe('block')
|
expect(elm.style.display).toBe('block')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('border related style should update correctly', () => {
|
||||||
|
const vnode1 = new VNode('p', {
|
||||||
|
style: { border: '10px solid red', 'border-bottom': '10px solid blue' }
|
||||||
|
})
|
||||||
|
const vnode2 = new VNode('p', {
|
||||||
|
style: {
|
||||||
|
'border-right': '10px solid red',
|
||||||
|
'border-bottom': '10px solid blue'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
patch(null, vnode1)
|
||||||
|
const elm = patch(vnode1, vnode2)
|
||||||
|
expect(elm.style.borderBottom).toBe('10px solid blue')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user