Add initial profile background image handling

This commit is contained in:
Johannes Zellner
2025-03-25 15:05:08 +01:00
parent 1f8cdbaf62
commit 23dd575ce1
6 changed files with 53 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ import { useTemplateRef, ref } from 'vue';
const fileInput = useTemplateRef('fileInput');
const props = defineProps(['src', 'fallbackSrc', 'size', 'maxSize', 'displayHeight']);
const props = defineProps(['src', 'fallbackSrc', 'size', 'maxSize', 'displayHeight', 'displayWidth']);
const emits = defineEmits(['changed']);
defineExpose({
clear(originalSrc = '') {
@@ -117,7 +117,7 @@ function onError() {
<input @change="onChanged($event)" type="file" ref="fileInput" style="display: none" accept="image/*"/>
<div ref="image" class="image-picker" @click="onShowIconSelector()">
<img :src="internalSrc || src" @error="onError" :style="{ height: displayHeight || null }" />
<img :src="internalSrc || src" @error="onError" :style="{ height: displayHeight || null, width: displayWidth || null }">
<i class="image-picker-edit-indicator fa fa-pencil-alt"></i>
</div>
</div>
@@ -134,7 +134,7 @@ function onError() {
.image-picker > img {
display: block;
height: 320px;
/* height: 320px;*/
border-radius: 10px;
}