@dolphinweex/weex-vue-render 0.2.65 → 0.2.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3899,13 +3899,19 @@ function px2rem (px, rootValue = 75) {
3899
3899
  // fix: 适配鸿蒙wx单位
3900
3900
  if (px.indexOf("--harmory") > -1) return px;
3901
3901
 
3902
- return px.replace(/([+-]?\d+(?:\.\d*)?)([p|w]x)?/g, function ($0, $1, $2, offset, str) {
3902
+ return px.replace(/([+-]?\d+(?:\.\d*)?)([p|w]x|%)?/g, function ($0, $1, $2, offset, str) {
3903
3903
  // 判断是否包含 scale 或 rotate,直接跳过
3904
3904
  const filterKey = ['scale', 'rotate'];
3905
3905
  if (filterKey.some(keyword => str.slice(0, offset).includes(keyword))) {
3906
3906
  return $0; // 保留原字符串不替换
3907
3907
  }
3908
- if (ignoreSubKey.filter(k => str.slice(offset - k.length - 1, offset - 1) === k).length) return $1
3908
+ if (ignoreSubKey.filter(k => str.slice(offset - k.length - 1, offset - 1) === k).length) return $1
3909
+
3910
+ // 如果是百分比单位,直接返回原值不做转换
3911
+ if ($2 === '%') {
3912
+ return $0; // 保留原字符串 translateY(0%)
3913
+ }
3914
+
3909
3915
  if ($2 === 'wx') { // 'wx' -> px
3910
3916
  // return ($midea_harmony_native ? $midea_harmony_native.vp2px($1) : $1) + 'px'
3911
3917
  // 适配鸿蒙wx
package/package.json CHANGED
@@ -49,5 +49,5 @@
49
49
  "type": "git",
50
50
  "url": "git+ssh://git@github.com/weexteam/weex-vue-render.git"
51
51
  },
52
- "version": "0.2.65"
52
+ "version": "0.2.66"
53
53
  }