Skip to content

Commit

Permalink
Merge pull request #187 from 201608010514/release-3.6.8-app
Browse files Browse the repository at this point in the history
fix: 当设置图片mode=""时,转换改为默认值
  • Loading branch information
qican77 authored Sep 8, 2023
2 parents 4710ec7 + 26d96a0 commit 87c733e
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 87c733e

Please sign in to comment.