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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.24.0",
|
|
4
4
|
"description": "A UI framework for Vue.js 3 (and 2) with only the bright side. :sunny:",
|
|
5
5
|
"author": "Antoni Andre <antoniandre.web@gmail.com>",
|
|
6
6
|
"homepage": "https://antoniandre.github.io/wave-ui",
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
component.w-image(
|
|
2
|
+
component.w-image(
|
|
3
|
+
:is="wrapperTag"
|
|
4
|
+
ref="imageWrap"
|
|
5
|
+
:class="wrapperClasses"
|
|
6
|
+
:style="wrapperStyles"
|
|
7
|
+
@error="error = true")
|
|
3
8
|
transition(:name="transition" appear)
|
|
4
9
|
component.w-image__image(
|
|
5
10
|
v-if="loaded"
|
|
@@ -60,6 +65,7 @@ export default {
|
|
|
60
65
|
return {
|
|
61
66
|
loading: false,
|
|
62
67
|
loaded: false,
|
|
68
|
+
error: false,
|
|
63
69
|
// The computed image source, and real image dimensions.
|
|
64
70
|
computedImg: {
|
|
65
71
|
src: '',
|
|
@@ -92,7 +98,8 @@ export default {
|
|
|
92
98
|
return {
|
|
93
99
|
'w-image--absolute': this.absolute,
|
|
94
100
|
'w-image--fixed': this.fixed,
|
|
95
|
-
'w-image--has-ratio': this.normalized.ratio
|
|
101
|
+
'w-image--has-ratio': this.normalized.ratio,
|
|
102
|
+
'w-image--error': this.error
|
|
96
103
|
}
|
|
97
104
|
},
|
|
98
105
|
|
|
@@ -160,7 +167,8 @@ export default {
|
|
|
160
167
|
return resolve(img)
|
|
161
168
|
}
|
|
162
169
|
img.onerror = error => {
|
|
163
|
-
this
|
|
170
|
+
this.error = true
|
|
171
|
+
this.$emit('error', error, this.$refs.imageWrap)
|
|
164
172
|
// If a fallback is provided & not already trying to load it, load the fallback src.
|
|
165
173
|
if (this.fallback && !loadFallback) {
|
|
166
174
|
this.loading = false
|