@dolphinweex/weex-vue-render 0.2.92 → 0.2.94
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.
- package/dist/index.common.js +17 -6
- package/package.json +1 -1
package/dist/index.common.js
CHANGED
|
@@ -5851,22 +5851,34 @@ function getImage(weex) {
|
|
|
5851
5851
|
return path + processedAppendStr;
|
|
5852
5852
|
},
|
|
5853
5853
|
checkTrim(url) {
|
|
5854
|
-
try{
|
|
5854
|
+
try {
|
|
5855
5855
|
// 检查URL是否有效
|
|
5856
5856
|
if (!url || url === 'undefined') {
|
|
5857
5857
|
return '';
|
|
5858
5858
|
}
|
|
5859
|
+
|
|
5860
|
+
// 处理 base64 中的换行符
|
|
5861
|
+
if (url.indexOf('data:') === 0) {
|
|
5862
|
+
const commaIndex = url.indexOf(',');
|
|
5863
|
+
if (commaIndex !== -1) {
|
|
5864
|
+
const header = url.substring(0, commaIndex + 1);
|
|
5865
|
+
const data = url.substring(commaIndex + 1).replace(/[\r\n\s]/g, '');
|
|
5866
|
+
return header + data;
|
|
5867
|
+
}
|
|
5868
|
+
return url.replace(/[\r\n\s]/g, '');
|
|
5869
|
+
}
|
|
5870
|
+
|
|
5859
5871
|
// 编码空格与括号,避免 CSS url() 与资源解析失败
|
|
5860
5872
|
if (url.includes(' ') || url.includes('(') || url.includes(')')) {
|
|
5861
5873
|
let processed = url.replace(/\s/g, match => encodeURIComponent(match));
|
|
5862
5874
|
processed = processed.replace(/\(/g, '%28').replace(/\)/g, '%29');
|
|
5863
|
-
return processed
|
|
5875
|
+
return processed;
|
|
5864
5876
|
}
|
|
5865
|
-
}catch(e){
|
|
5877
|
+
} catch(e) {
|
|
5866
5878
|
// 静默处理错误,返回空字符串
|
|
5867
5879
|
return '';
|
|
5868
5880
|
}
|
|
5869
|
-
return url
|
|
5881
|
+
return url;
|
|
5870
5882
|
},
|
|
5871
5883
|
|
|
5872
5884
|
harmonyTouchStart(event){
|
|
@@ -5910,8 +5922,7 @@ function getImage(weex) {
|
|
|
5910
5922
|
staticStyle: {
|
|
5911
5923
|
backgroundImage: displaySrc ? `url(${this.checkTrim(displaySrc)})` : '',
|
|
5912
5924
|
backgroundSize: this.resize || "stretch",
|
|
5913
|
-
backgroundRepeat: "no-repeat"
|
|
5914
|
-
zIndex: 1,
|
|
5925
|
+
backgroundRepeat: "no-repeat"
|
|
5915
5926
|
},
|
|
5916
5927
|
});
|
|
5917
5928
|
},
|
package/package.json
CHANGED