diff options
Diffstat (limited to 'src/components/Global/FormFile.vue')
-rw-r--r-- | src/components/Global/FormFile.vue | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/components/Global/FormFile.vue b/src/components/Global/FormFile.vue index 907f3004b..48bab7ecc 100644 --- a/src/components/Global/FormFile.vue +++ b/src/components/Global/FormFile.vue @@ -41,13 +41,19 @@ variant="light" class="px-2 ml-auto" :disabled="disabled" - @click="file = null" + @click="closeFile" ><icon-close :title="$t('global.fileUpload.clearSelectedFile')" /><span class="sr-only" >{{ $t('global.fileUpload.clearSelectedFile') }}</span > </b-button> </div> + <div + v-if="fileName && isStarted" + class="clear-selected-file px-3 py-2 mt-2" + > + {{ fileName }} + </div> </div> </template> @@ -79,10 +85,15 @@ export default { type: String, default: 'secondary', }, + isStarted: { + type: Boolean, + default: false, + }, }, data() { return { file: null, + fileName: null, }; }, computed: { @@ -93,10 +104,18 @@ export default { watch: { file() { if (this.file) { + this.fileName = this.file.name; this.$bvModal.hide(`modal-${this.id}`); } }, }, + + methods: { + closeFile() { + this.fileName = null; + this.file = null; + }, + }, }; </script> <style lang="scss" scoped> |