Vue-dropzone: "Remove File" button lost.

Created on 16 Jul 2018  Â·  3Comments  Â·  Source: rowanwins/vue-dropzone

<dropzone
        ref="test"
        v-if="!isUploader"
        :id="formItem.id"
        @vdropzone-max-files-exceeded="checkExceeded"
        @vdropzone-success="onUploadSuccess"
        @vdropzone-removed-file="onRemoveUploadingFile"
        @vdropzone-max-files-reached="onAddFiles"
        :options="dzOptions">
        <input type="hidden" name="token" value="xxx">
      </dropzone>
computed: {
      dzOptions () {
        let config = {
          dictDefaultMessage: '将本地文件拖到此处,或点击上传',
          url: '/api/upload_file/',
          acceptedMimeTypes: this.formItem.value.regex.join(','),
        }
        if (this.formItem.value.type === 'file') {
          return {
            ...config,
            maxFiles: 1
          }
        } else {
          return {
            ...config,
            maxFiles: 20
          }
        }
      },

image

See, the "REMOVE FILE" button is lost.

Most helpful comment

In your dzOptions you need to have addRemoveLinks: true

All 3 comments

In your dzOptions you need to have addRemoveLinks: true

thanks for help

Thanks! But i cannot find this in docs

Was this page helpful?
0 / 5 - 0 ratings