From 24a400dad376c71a72342179854a7308bf4ceae4 Mon Sep 17 00:00:00 2001
From: Andres2908
{{ file.name || "Arrastra aquí tu archivo o da click para buscar"}}
+Tamaño máximo para el archivo: 20MB
@@ -32,6 +33,27 @@ export default { return { file: '' } + }, + methods: { + validarTamaño () { + const TamMax = 20000000 + const archivo = this.file + if (archivo.size > TamMax) { + this.toast() + this.file = '' + } + }, + toast () { + this.$buefy.toast.open({ + message: 'El archivo excede el tamaño permitido', + type: 'is-danger' + }) + } + }, + watch: { + file: function (newFile, oldFile) { + this.validarTamaño() + } } } diff --git a/components/responsable/cartaTermino.vue b/components/responsable/cartaTermino.vue index 54dd2aa..2f78a4b 100644 --- a/components/responsable/cartaTermino.vue +++ b/components/responsable/cartaTermino.vue @@ -5,12 +5,13 @@
{{ file.name || "Arrastra aquí tu archivo o da click para buscar"}}
-Tamaño máximo para el archivo: 20MB
+