|
@@ -9,16 +9,19 @@ import { UserStore } from '@stores/user'
|
|
|
|
|
|
import SvgIcon from '@jamescoyle/vue-icon';
|
|
|
import { mdiTrashCanOutline } from '@mdi/js';
|
|
|
+import { mdiImagePlus } from '@mdi/js';
|
|
|
|
|
|
export default {
|
|
|
props: {
|
|
|
+ can_update: Boolean,
|
|
|
image: Object,
|
|
|
data: Object
|
|
|
},
|
|
|
emits: ['updated'],
|
|
|
data(){
|
|
|
return {
|
|
|
- mdiTrashCanOutline_path: mdiTrashCanOutline
|
|
|
+ mdiTrashCanOutline_path: mdiTrashCanOutline,
|
|
|
+ mdiImagePlus_path: mdiImagePlus
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -121,13 +124,15 @@ export default {
|
|
|
<img :src="image[0].url" :alt="image[0].alt"/>
|
|
|
<figcaption v-if="image[0].alt">{{ image[0].alt }}</figcaption>
|
|
|
</figure>
|
|
|
- <svg-icon type="mdi" :path="mdiTrashCanOutline_path" @click="onDeleteImg" />
|
|
|
+ <div v-if="can_update" @click="onDeleteImg" class="delete-btn">
|
|
|
+ <svg-icon type="mdi" :path="mdiTrashCanOutline_path" />
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<!-- with out img -->
|
|
|
- <template v-else>
|
|
|
+ <template v-else-if="can_update">
|
|
|
<div @click="addImage" class="btn">
|
|
|
-
|
|
|
- <span>ajouter une image</span>
|
|
|
+ <svg-icon type="mdi" :path="mdiImagePlus_path" @click="onDeleteImg" />
|
|
|
+ <!-- <span>ajouter une image</span> -->
|
|
|
</div>
|
|
|
<input ref="image_input" type="file" accept ="image/jpeg, image/png, image/jpg" @input="onInput">
|
|
|
</template>
|