fix(runtime-dom): style binding multi value support

fix #1759
This commit is contained in:
Evan You
2020-08-03 17:13:17 -04:00
parent f6afe7000e
commit 0cd98c3040
2 changed files with 36 additions and 16 deletions

View File

@@ -74,6 +74,7 @@ describe(`runtime-dom: style patching`, () => {
const store: any = {}
return {
style: {
display: '',
WebkitTransition: '',
setProperty(key: string, val: string) {
store[key] = val
@@ -96,4 +97,15 @@ describe(`runtime-dom: style patching`, () => {
patchProp(el as any, 'style', {}, { transition: 'all 1s' })
expect(el.style.WebkitTransition).toBe('all 1s')
})
it('multiple values', () => {
const el = mockElementWithStyle()
patchProp(
el as any,
'style',
{},
{ display: ['-webkit-box', '-ms-flexbox', 'flex'] }
)
expect(el.style.display).toBe('flex')
})
})