@burh/nuxt-core 1.0.39 → 1.0.41

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.
@@ -114,6 +114,9 @@
114
114
  }
115
115
  })
116
116
  })
117
+ },
118
+ removeAllFiles() {
119
+ this.dropzone.removeAllFiles(true);
117
120
  }
118
121
  },
119
122
  async mounted() {
@@ -16,7 +16,7 @@
16
16
  <template slot="footer">
17
17
  <base-button type="link" @click="$emit('btn-first-click')">Fechar
18
18
  </base-button>
19
- <base-button type="primary" class="ml-auto" @click="$emit('btn-second-click')">Criar Cópia Editável</base-button>
19
+ <base-button type="primary" class="mx-auto" @click="$emit('btn-second-click')">Criar Cópia Editável</base-button>
20
20
  </template>
21
21
  </modal>
22
22
  </template>
@@ -4,14 +4,20 @@
4
4
  <div class=""><h2 class="display-4">Editar capa do treinamento</h2></div>
5
5
  </template>
6
6
 
7
- <dropzone-file-upload v-model="fileToUpload"></dropzone-file-upload>
7
+ <dropzone-file-upload v-if="!image" ref="Mydropzone" v-model="fileToUpload" class=""></dropzone-file-upload>
8
8
 
9
- <div class="d-flex">
10
- <base-button size="md" type="primary" role="button"
9
+ <div class="row mb-4" v-if="image">
10
+ <img class="col-12" :src="image" alt="Cover">
11
+ </div>
12
+
13
+ <template slot="footer">
14
+ <base-button type="link" @click="removeImage">Remover Imagem
15
+ </base-button>
16
+ <base-button type="primary" class="ml-auto" role="button"
11
17
  @click="saveImage"
12
- class="ml-auto">Salvar Imagem
18
+ >Salvar Imagem
13
19
  </base-button>
14
- </div>
20
+ </template>
15
21
  </modal>
16
22
  </template>
17
23
  <script>
@@ -21,7 +27,11 @@ export default {
21
27
  DropzoneFileUpload,
22
28
  },
23
29
  props:{
24
- show: false
30
+ show: false,
31
+ image: {
32
+ type: String,
33
+ default: null
34
+ }
25
35
  },
26
36
  data(){
27
37
  return{
@@ -42,12 +52,25 @@ export default {
42
52
  }
43
53
  },
44
54
  methods:{
45
- async saveImage(){
46
- let image = this.fileToUpload
47
- this.$emit('save-img', image)
55
+ removeImage() {
56
+ if(!this.image) {
57
+ this.$refs.Mydropzone.removeAllFiles();
58
+ }
59
+ this.$emit('remove-image')
60
+ },
61
+ async saveImage() {
62
+ if(this.fileToUpload != null) {
63
+ let image = this.fileToUpload
64
+ this.$emit('save-img', image)
65
+ }
48
66
 
49
67
  this.$emit('close-modal-video')
50
68
  }
69
+ },
70
+ watch: {
71
+ image(e) {
72
+ console.log(e);
73
+ }
51
74
  }
52
75
  }
53
76
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burh/nuxt-core",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "scripts": {