提交 2ef47f4d 编写于 作者: Y yurj26

fix(app): background base64 disable rpx2px

上级 91fd4040
......@@ -3,7 +3,7 @@ import { rpx2px } from '@dcloudio/uni-core'
import { getRealPath } from '../platform/getRealPath'
export function normalizeStyleValue(val: string) {
return normalizeUrl(rpx2px(val, true))
return normalizeUrl(normalizeRpx(val))
}
const urlRE = /url\(\s*'?"?([a-zA-Z0-9\.\-\_\/]+\.(jpg|gif|png))"?'?\s*\)/
......@@ -18,6 +18,18 @@ const normalizeUrl = (val: string) => {
return val
}
const rpxRE = /\b([+-]?\d+(\.\d+)?)[r|u]px\b/g
const normalizeRpx = (val: string) => {
if (isString(val)) {
return val.replace(rpxRE, (a, b) => {
// @ts-ignore
return rpx2px(b) + 'px'
})
}
return val
}
// 移动端,仅处理 Webkit
const prefixes = ['Webkit' /*, 'Moz', 'ms'*/]
const prefixCache: Record<string, string> = {}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册