[fix] fix issue #4. preview load when image is deleted
This commit is contained in:
parent
c5080a2642
commit
76b0caa62e
|
@ -240,7 +240,7 @@ export default defineComponent({
|
|||
edit_drink.value?.receipt?.splice(event, 1);
|
||||
}
|
||||
|
||||
const drinkPic = ref();
|
||||
const drinkPic = ref<File | undefined>();
|
||||
const imgsrc = ref();
|
||||
|
||||
const deletePic = ref(false);
|
||||
|
@ -274,6 +274,9 @@ export default defineComponent({
|
|||
if (imgsrc.value) {
|
||||
return <string>imgsrc.value;
|
||||
}
|
||||
if (deletePic.value && !imgsrc.value) {
|
||||
return 'no-image.svg';
|
||||
}
|
||||
if (edit_drink.value?.has_image) {
|
||||
return `${api.defaults.baseURL || ''}/pricelist/drinks/${
|
||||
edit_drink.value.id
|
||||
|
|
Loading…
Reference in New Issue