Skip to content

Commit 44e03b5

Browse files
authored
Merge pull request #2064 from didi/fix-line-height-0
bugfix: line-height 0 编译成 line-height 0%
2 parents c57f70c + 875e4f7 commit 44e03b5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • packages/webpack-plugin/lib/platform/style/wx

packages/webpack-plugin/lib/platform/style/wx/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,13 @@ module.exports = function getSpec ({ warn, error }) {
285285

286286
// line-height
287287
const formatLineHeight = ({ prop, value, selector }) => {
288+
// line-height 0 直接返回
289+
if (+value === 0) {
290+
return {
291+
prop,
292+
value
293+
}
294+
}
288295
return verifyValues({ prop, value, selector }) && ({
289296
prop,
290297
value: /^\s*(-?(\d+(\.\d+)?|\.\d+))\s*$/.test(value) ? `${Math.round(value * 100)}%` : value

0 commit comments

Comments
 (0)