@mixd-id/web-scaffold 0.1.2301231322 → 0.1.2301231323
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
package/src/components/Image.vue
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="computedOuterClass"
|
|
2
|
+
<div :class="computedOuterClass">
|
|
3
|
+
<slot v-if="editable && $slots['edit-area']" name="edit-area"></slot>
|
|
4
|
+
<div v-else-if="editable" :class="$style.editArea" @click="edit"></div>
|
|
3
5
|
<img :class="computedClass" :src="actualSrc" ref="img" :style="imageStyle"/>
|
|
4
6
|
<input v-if="Boolean(editable)" class="hidden" type="file" accept="image/*" ref="file" @change="onChange"/>
|
|
5
7
|
<slot></slot>
|
|
@@ -54,7 +56,8 @@ export default{
|
|
|
54
56
|
|
|
55
57
|
computedOuterClass(){
|
|
56
58
|
return [
|
|
57
|
-
this.$style.img
|
|
59
|
+
this.$style.img,
|
|
60
|
+
this.outerClass
|
|
58
61
|
]
|
|
59
62
|
.join(' ')
|
|
60
63
|
},
|
|
@@ -102,7 +105,7 @@ export default{
|
|
|
102
105
|
}
|
|
103
106
|
},
|
|
104
107
|
|
|
105
|
-
|
|
108
|
+
edit(){
|
|
106
109
|
if(this.$refs.file){
|
|
107
110
|
this.$refs.file.click()
|
|
108
111
|
}
|
|
@@ -193,6 +196,10 @@ export default{
|
|
|
193
196
|
@apply relative;
|
|
194
197
|
}
|
|
195
198
|
|
|
199
|
+
.editArea{
|
|
200
|
+
@apply absolute top-0 left-0 right-0 bottom-0;
|
|
201
|
+
}
|
|
202
|
+
|
|
196
203
|
.isLoading{
|
|
197
204
|
@apply absolute top-0 left-0 right-0 bottom-0;
|
|
198
205
|
@apply flex items-center justify-center;
|