|
49 | 49 | type: Boolean,
|
50 | 50 | default: true
|
51 | 51 | },
|
| 52 | + useFontAwesome: { |
| 53 | + type: Boolean, |
| 54 | + default: false |
| 55 | + }, |
52 | 56 | useCustomDropzoneOptions: {
|
53 | 57 | type: Boolean,
|
54 | 58 | default: false
|
|
65 | 69 | this.dropzone.processQueue()
|
66 | 70 | }
|
67 | 71 | },
|
| 72 | + computed: { |
| 73 | + cloudIcon: function () { |
| 74 | + if (this.useFontAwesome) { |
| 75 | + return '<i class="fa fa-cloud-upload"></i>' |
| 76 | + } else { |
| 77 | + return '<i class="material-icons">cloud_upload</i>' |
| 78 | + } |
| 79 | + }, |
| 80 | + doneIcon: function () { |
| 81 | + if (this.useFontAwesome) { |
| 82 | + return '<i class="fa fa-check"></i>' |
| 83 | + } else { |
| 84 | + return ' <i class="material-icons">done</i>' |
| 85 | + } |
| 86 | + }, |
| 87 | + errorIcon: function () { |
| 88 | + if (this.useFontAwesome) { |
| 89 | + return '<i class="fa fa-close"></i>' |
| 90 | + } else { |
| 91 | + return ' <i class="material-icons">error</i>' |
| 92 | + } |
| 93 | + } |
| 94 | + }, |
68 | 95 | mounted () {
|
69 | 96 | var element = document.getElementById(this.id)
|
70 | 97 | if (!this.useCustomDropzoneOptions) {
|
|
78 | 105 | addRemoveLinks: this.showRemoveLink,
|
79 | 106 | acceptedFiles: this.acceptedFileTypes,
|
80 | 107 | autoProcessQueue: this.autoProcessQueue,
|
81 |
| - dictDefaultMessage: '<i class="material-icons">cloud_upload</i><br>Drop files here to upload', |
82 |
| - previewTemplate: '<div class="dz-preview dz-file-preview"> <div class="dz-image" style="width:' + this.thumbnailWidth + 'px;height:' + this.thumbnailHeight + 'px"><img data-dz-thumbnail /></div> <div class="dz-details"> <div class="dz-size"><span data-dz-size></span></div> <div class="dz-filename"><span data-dz-name></span></div> </div> <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div> <div class="dz-error-message"><span data-dz-errormessage></span></div> <div class="dz-success-mark"> <i class="material-icons">done</i> </div> <div class="dz-error-mark"><i class="material-icons">error</i></div></div>' |
| 108 | + dictDefaultMessage: this.cloudIcon +'<br>Drop files here to upload', |
| 109 | + previewTemplate: '<div class="dz-preview dz-file-preview"> <div class="dz-image" style="width:' + this.thumbnailWidth + 'px;height:' + this.thumbnailHeight + 'px"><img data-dz-thumbnail /></div> <div class="dz-details"> <div class="dz-size"><span data-dz-size></span></div> <div class="dz-filename"><span data-dz-name></span></div> </div> <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div> <div class="dz-error-message"><span data-dz-errormessage></span></div> <div class="dz-success-mark">' + this.doneIcon + ' </div> <div class="dz-error-mark' + this.errorIcon + '</div></div>' |
83 | 110 | })
|
84 | 111 | } else {
|
85 | 112 | this.dropzone = new Dropzone(element, this.dropzoneOptions)
|
|
0 commit comments