diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-04 22:06:48 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-04 22:06:48 +0300 |
commit | 24db902588214be54d651f627a080b61bfc39a38 (patch) | |
tree | 1f1ce272de6aae3db8241dde166d766edf94c396 /src/components/Global/FormFile.vue | |
parent | 83b1f3104e0564ca40bdeaf08f7f728e423e7f85 (diff) | |
download | webui-vue-24db902588214be54d651f627a080b61bfc39a38.tar.xz |
add file name
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> |