Skip to content

Commit

Permalink
fix(vue): fixed remove style issue (Tencent#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuqingkuang authored and boxizen committed Aug 16, 2021
1 parent aef8558 commit bfd90a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/hippy-vue/src/runtime/modules/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ function updateStyle(oldVNode, vNode) {
style = extend({}, style);
vNode.data.style = style;
}
// Remove the removed styles at first
Object.keys(oldStyle).forEach((name) => {
if (style[name] === undefined) {
elm.setStyle(normalize(name), '');
elm.setStyle(normalize(name), undefined);
}
});
// Then set the new styles.
Object.keys(style).forEach((name) => {
cur = style[name];
elm.setStyle(normalize(name), cur);
Expand Down

0 comments on commit bfd90a6

Please sign in to comment.