allow multiple file upload

This commit is contained in:
Henry Jameson 2018-08-28 14:05:03 +03:00
parent 68d15f665e
commit 8e560676f1
2 changed files with 5 additions and 3 deletions

View file

@ -6,8 +6,10 @@ const mediaUpload = {
const input = this.$el.querySelector('input') const input = this.$el.querySelector('input')
input.addEventListener('change', ({target}) => { input.addEventListener('change', ({target}) => {
const file = target.files[0] for (var i = 0; i < target.files.length; i++) {
let file = target.files[i]
this.uploadFile(file) this.uploadFile(file)
}
}) })
}, },
data () { data () {

View file

@ -3,7 +3,7 @@
<label class="btn btn-default"> <label class="btn btn-default">
<i class="icon-spin4 animate-spin" v-if="uploading"></i> <i class="icon-spin4 animate-spin" v-if="uploading"></i>
<i class="icon-upload" v-if="!uploading"></i> <i class="icon-upload" v-if="!uploading"></i>
<input type=file style="position: fixed; top: -100em"></input> <input type="file" style="position: fixed; top: -100em" multiple="true"></input>
</label> </label>
</div> </div>
</template> </template>