@veritree/ui 0.58.0 → 0.58.2
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/package.json
CHANGED
|
@@ -60,12 +60,14 @@ export default {
|
|
|
60
60
|
return this.placeholder;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
if (this.
|
|
64
|
-
return this.
|
|
63
|
+
if (this.src) {
|
|
64
|
+
return this.src.includes('cloudfront.net/')
|
|
65
|
+
? handleImageResizing(this.src, this.$attrs.width)
|
|
66
|
+
: this.src;
|
|
65
67
|
}
|
|
66
68
|
|
|
67
|
-
if (this.
|
|
68
|
-
return this.
|
|
69
|
+
if (this.cdnSrc) {
|
|
70
|
+
return handleImageResizing(this.cdnSrc, this.$attrs.width);
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
|
|
@@ -88,8 +90,6 @@ export default {
|
|
|
88
90
|
},
|
|
89
91
|
|
|
90
92
|
methods: {
|
|
91
|
-
handleImageResizing,
|
|
92
|
-
|
|
93
93
|
onLoad() {
|
|
94
94
|
this.isLoaded = true;
|
|
95
95
|
},
|
package/src/utils/images.js
CHANGED
|
@@ -7,12 +7,18 @@ export const handleImageResizing = (url, width) => {
|
|
|
7
7
|
let cdn;
|
|
8
8
|
|
|
9
9
|
try {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
// new code
|
|
11
|
+
if(typeof url === 'string' && url.includes('cloudfront.net/')) {
|
|
12
|
+
cdn = url;
|
|
13
|
+
} else {
|
|
14
|
+
// old code
|
|
15
|
+
if (typeof url === 'object') {
|
|
16
|
+
cdn = url.cdn_url;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (typeof url === 'string') {
|
|
20
|
+
cdn = JSON.parse(url).cdn_url;
|
|
21
|
+
}
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
const base64String = cdn.split('net/');
|