wave-ui 3.23.1 → 3.24.0
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/wave-ui.cjs.js +1 -1
- package/dist/wave-ui.css +1 -1
- package/dist/wave-ui.es.js +8 -4
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +1 -1
- package/src/wave-ui/components/w-image.vue +11 -3
package/dist/wave-ui.es.js
CHANGED
|
@@ -3314,7 +3314,9 @@ function pl(e, t, i, s, n, l) {
|
|
|
3314
3314
|
const a = V("w-progress");
|
|
3315
3315
|
return o(), b(R(l.wrapperTag), {
|
|
3316
3316
|
class: f(["w-image", l.wrapperClasses]),
|
|
3317
|
-
|
|
3317
|
+
ref: "imageWrap",
|
|
3318
|
+
style: x(l.wrapperStyles),
|
|
3319
|
+
onError: t[0] || (t[0] = (r) => n.error = !0)
|
|
3318
3320
|
}, {
|
|
3319
3321
|
default: m(() => [
|
|
3320
3322
|
L(P, {
|
|
@@ -3359,7 +3361,7 @@ function pl(e, t, i, s, n, l) {
|
|
|
3359
3361
|
}, null, 10, cl)) : p("", !0)
|
|
3360
3362
|
]),
|
|
3361
3363
|
_: 3
|
|
3362
|
-
},
|
|
3364
|
+
}, 40, ["class", "style"]);
|
|
3363
3365
|
}
|
|
3364
3366
|
const fl = {
|
|
3365
3367
|
name: "w-image",
|
|
@@ -3389,6 +3391,7 @@ const fl = {
|
|
|
3389
3391
|
return {
|
|
3390
3392
|
loading: !1,
|
|
3391
3393
|
loaded: !1,
|
|
3394
|
+
error: !1,
|
|
3392
3395
|
// The computed image source, and real image dimensions.
|
|
3393
3396
|
computedImg: {
|
|
3394
3397
|
src: "",
|
|
@@ -3417,7 +3420,8 @@ const fl = {
|
|
|
3417
3420
|
return {
|
|
3418
3421
|
"w-image--absolute": this.absolute,
|
|
3419
3422
|
"w-image--fixed": this.fixed,
|
|
3420
|
-
"w-image--has-ratio": this.normalized.ratio
|
|
3423
|
+
"w-image--has-ratio": this.normalized.ratio,
|
|
3424
|
+
"w-image--error": this.error
|
|
3421
3425
|
};
|
|
3422
3426
|
},
|
|
3423
3427
|
wrapperStyles() {
|
|
@@ -3451,7 +3455,7 @@ const fl = {
|
|
|
3451
3455
|
return this.loading = !0, this.loaded = !1, this.$emit("loading", e ? this.fallback : this.src), new Promise((t) => {
|
|
3452
3456
|
const i = new Image();
|
|
3453
3457
|
i.onload = (s) => (this.computedImg.width = s.target.width, this.computedImg.height = s.target.height, this.computedImg.ratio = s.target.height / s.target.width, this.loading = !1, this.loaded = !0, this.computedImg.src = e ? this.fallback : this.src, this.$emit("loaded", this.computedImg.src), t(i)), i.onerror = (s) => {
|
|
3454
|
-
this.$emit("error", s), this.fallback && !e ? (this.loading = !1, this.loadImage(!0)) : (this.loading = !1, this.loaded = !1);
|
|
3458
|
+
this.error = !0, this.$emit("error", s, this.$refs.imageWrap), this.fallback && !e ? (this.loading = !1, this.loadImage(!0)) : (this.loading = !1, this.loaded = !1);
|
|
3455
3459
|
}, i.src = e ? this.fallback : this.src;
|
|
3456
3460
|
});
|
|
3457
3461
|
}
|