@burh/nuxt-core 1.0.43 → 1.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
preview.innerHTML = ''
|
|
100
100
|
let evtList = ['drop', 'dragstart', 'dragend', 'dragenter', 'dragover', 'addedfile', 'removedfile', 'thumbnail', 'error', 'processing', 'uploadprogress', 'sending', 'success', 'complete', 'canceled', 'maxfilesreached', 'maxfilesexceeded', 'processingmultiple', 'sendingmultiple', 'successmultiple', 'completemultiple', 'canceledmultiple', 'totaluploadprogress', 'reset', 'queuecomplete']
|
|
101
101
|
evtList.forEach(evt => {
|
|
102
|
-
this.dropzone.on(evt, (data) => {
|
|
103
|
-
this.$emit(evt, data);
|
|
102
|
+
this.dropzone.on(evt, (data, message) => {
|
|
103
|
+
this.$emit(evt, data, message);
|
|
104
104
|
|
|
105
105
|
if (evt === 'addedfile') {
|
|
106
106
|
this.files.push(data)
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
<div class=""><h2 class="display-4">Editar capa do treinamento</h2></div>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
|
-
<dropzone-file-upload v-if="
|
|
7
|
+
<dropzone-file-upload v-if="image == null"
|
|
8
|
+
v-on:error="showError"
|
|
9
|
+
ref="Mydropzone" :options="dropzoneOptions" v-model="fileToUpload" class=""/>
|
|
8
10
|
|
|
9
|
-
<div class="row mb-4" v-if="image">
|
|
11
|
+
<div class="row mb-4" v-if="image != null">
|
|
10
12
|
<img class="col-12" :src="image" alt="Cover">
|
|
11
13
|
</div>
|
|
12
14
|
|
|
@@ -22,6 +24,8 @@
|
|
|
22
24
|
</template>
|
|
23
25
|
<script>
|
|
24
26
|
import DropzoneFileUpload from '@burh/nuxt-core/components/argon-core/Inputs/DropzoneFileUpload.vue';
|
|
27
|
+
import swal from "sweetalert2";
|
|
28
|
+
|
|
25
29
|
export default {
|
|
26
30
|
components: {
|
|
27
31
|
DropzoneFileUpload,
|
|
@@ -36,6 +40,12 @@ export default {
|
|
|
36
40
|
data(){
|
|
37
41
|
return{
|
|
38
42
|
fileToUpload: null,
|
|
43
|
+
dropzoneOptions: {
|
|
44
|
+
maxFiles: 1,
|
|
45
|
+
maxFilesize: .2,
|
|
46
|
+
dictFileTooBig: "A imagem que você tentou inserir é maior que 200KB",
|
|
47
|
+
dictDefaultMessage: "Clique ou arraste seu arquivo aqui"
|
|
48
|
+
},
|
|
39
49
|
}
|
|
40
50
|
},
|
|
41
51
|
model:{
|
|
@@ -52,6 +62,16 @@ export default {
|
|
|
52
62
|
}
|
|
53
63
|
},
|
|
54
64
|
methods:{
|
|
65
|
+
showError(file, message) {
|
|
66
|
+
return swal.fire({
|
|
67
|
+
title: "Erro",
|
|
68
|
+
text: message,
|
|
69
|
+
type: "error",
|
|
70
|
+
buttonsStyling: false,
|
|
71
|
+
confirmButtonText: "Ok, fechar!",
|
|
72
|
+
confirmButtonClass: "btn btn-primary btn-fill",
|
|
73
|
+
});
|
|
74
|
+
},
|
|
55
75
|
removeImage() {
|
|
56
76
|
if(!this.image) {
|
|
57
77
|
this.$refs.Mydropzone.removeAllFiles();
|
|
@@ -67,11 +87,6 @@ export default {
|
|
|
67
87
|
this.$emit('close-modal-video')
|
|
68
88
|
}
|
|
69
89
|
},
|
|
70
|
-
watch: {
|
|
71
|
-
image(e) {
|
|
72
|
-
console.log(e);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
90
|
}
|
|
76
91
|
</script>
|
|
77
92
|
<style lang="scss" scoped>
|