[fix] fix issue #4. preview load when image is deleted

This commit is contained in:
Tim Gröger 2021-11-19 21:57:25 +01:00
parent c5080a2642
commit 76b0caa62e
1 changed files with 4 additions and 1 deletions

View File

@ -240,7 +240,7 @@ export default defineComponent({
edit_drink.value?.receipt?.splice(event, 1); edit_drink.value?.receipt?.splice(event, 1);
} }
const drinkPic = ref(); const drinkPic = ref<File | undefined>();
const imgsrc = ref(); const imgsrc = ref();
const deletePic = ref(false); const deletePic = ref(false);
@ -274,6 +274,9 @@ export default defineComponent({
if (imgsrc.value) { if (imgsrc.value) {
return <string>imgsrc.value; return <string>imgsrc.value;
} }
if (deletePic.value && !imgsrc.value) {
return 'no-image.svg';
}
if (edit_drink.value?.has_image) { if (edit_drink.value?.has_image) {
return `${api.defaults.baseURL || ''}/pricelist/drinks/${ return `${api.defaults.baseURL || ''}/pricelist/drinks/${
edit_drink.value.id edit_drink.value.id