Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/vuePublic

Commitf5ef882

Browse files
committed
fix(style): always set new styles
close#12901close#12946
1 parentd6468c4 commitf5ef882

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

‎src/platforms/web/runtime/modules/style.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,8 @@ function updateStyle(oldVnode: VNodeWithData, vnode: VNodeWithData) {
9191
}
9292
for(nameinnewStyle){
9393
cur=newStyle[name]
94-
if(cur!==oldStyle[name]){
95-
// ie9 setting to null has no effect, must use empty string
96-
setProp(el,name,cur==null ?'' :cur)
97-
}
94+
// ie9 setting to null has no effect, must use empty string
95+
setProp(el,name,cur==null ?'' :cur)
9896
}
9997
}
10098

‎test/unit/modules/vdom/modules/style.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,19 @@ describe('vdom style module', () => {
3636
expect(elm.style.fontSize).toBe('')
3737
expect(elm.style.display).toBe('block')
3838
})
39+
40+
it('border related style should update correctly',()=>{
41+
constvnode1=newVNode('p',{
42+
style:{border:'10px solid red','border-bottom':'10px solid blue'}
43+
})
44+
constvnode2=newVNode('p',{
45+
style:{
46+
'border-right':'10px solid red',
47+
'border-bottom':'10px solid blue'
48+
}
49+
})
50+
patch(null,vnode1)
51+
constelm=patch(vnode1,vnode2)
52+
expect(elm.style.borderBottom).toBe('10px solid blue')
53+
})
3954
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp