Skip to content

Commit

Permalink
fix: 当设置图片mode=""时,转换改为默认值
Browse files Browse the repository at this point in the history
  • Loading branch information
201608010514 committed Sep 8, 2023
1 parent 4710ec7 commit 26d96a0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/taroize/src/wxml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ export const createWxmlVistor = (
}
}

// 当设置图片mode="",则改为默认值(且taro不支持mode空值)
if (name.name === 'mode' && path.node.value === null) {
path.set('value', t.stringLiteral('scaleToFill'))
}

// 当设置 style 属性但未赋值则删除该属性
if (name.name === 'style' && !path.node.value) {
path.remove()
Expand Down

0 comments on commit 26d96a0

Please sign in to comment.