Skip to content

Commit

Permalink
refactor(Proof add): add option to hide image preview
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Nov 11, 2024
1 parent 9d10f27 commit 3ece9a0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/components/ProofImageInputRow.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<v-row>
<v-col :cols="proofImagePreview ? '8' : '12'">
<v-col :cols="showProofImagePreview ? '8' : '12'">
<h3 class="required mb-1">
{{ $t('Common.Image') }}
</h3>
Expand Down Expand Up @@ -49,7 +49,7 @@
:text="$t('AddPriceMultiple.ProofDetails.ReceiptWarning')"
/>
</v-col>
<v-col v-if="proofImagePreview" cols="4">
<v-col v-if="showProofImagePreview" cols="4">
<v-img :src="proofImagePreview" style="max-height:200px" />
</v-col>
</v-row>
Expand Down Expand Up @@ -84,6 +84,10 @@ export default {
type: Boolean,
default: false
},
hideProofImagePreview: {
type: Boolean,
default: false
}
},
emits: ['proof'],
data() {
Expand All @@ -96,6 +100,11 @@ export default {
loading: false
}
},
computed: {
showProofImagePreview() {
return !this.hideProofImagePreview && this.proofImagePreview
}
},
watch: {
proofImage(newProofImage, oldProofImage) { // eslint-disable-line no-unused-vars
this.$emit('proof', newProofImage)
Expand Down

0 comments on commit 3ece9a0

Please sign in to comment.