vue-dropzone 超级文件上传组件

 

安装

npm install vue2-dropzone

 

如何使用

<vue-dropzone ref="myVueDropzone" id="dropzone" :options="dropzoneOptions"></vue-dropzone>
import vue2Dropzone from 'vue2-dropzone'
import 'vue2-dropzone/dist/vue2Dropzone.min.css'
export default {
  name: 'app',
  components: {
    vueDropzone: vue2Dropzone
  },
  data: function () {
    return {
      dropzoneOptions: {
          url: 'https://httpbin.org/post',
          thumbnailWidth: 150,
          maxFilesize: 0.5,
          headers: { "My-Awesome-Header": "header value" }
      }
    }
  }
}

 

Demo 地址

基本演示 https://rowanwins.github.io/vue-dropzone/docs/dist/index.html#/demo

 

posted @ 2019-09-30 10:17  Vition  阅读(4428)  评论(0编辑  收藏  举报