Vue-dropzone: Problems with overriding options in new version

Created on 11 Aug 2017  路  7Comments  路  Source: rowanwins/vue-dropzone

  • Vue2-dropzone Version: 2.3.5
  • Node Version (6.9.5):
  • YARN Version (0.24.6):
  • OS: macOS Sierra

Description:

Hey, just ran into a problem where i updated a project, together with most of the packages. I was on ^2.2.4 version and had it updated on 2.3.5. The problem is that some settings for the plugin changed - options and preview template, which i found out later in the docs. Anyway, i had overridden dictDefaultMessage which is now under the language, but it doesn't remove the material design icon. It stays inside <span> and there is no way to remove it with that. I rolled back on the old version just so i didn't have a broken project.

Steps To Reproduce:

Update to the latest version, try to apply your own options and override language - dictDefaultMessage.

Most helpful comment

The language wrapper is no longer needed or valid. It is now simply:

dropzoneOptions: {
  dictDefaultMessage: 'Drop a PDF file here, or click to select a file to upload.'
}

Providing the language wrapper causes the entire thing to be ignored.

187

All 7 comments

We Apologize for inconvenience @janperse . We recently update the component to address all the options from dropzone and to overcome other issues too. I'll have look on it.

No problem, let me know if you'll get the same bug and if it's fixed so i can update a project. Thanks!

@janperse Can you post your code which is causing above mentioned error? Actually it seems hard to reproduce the same, with your code I can assist you better.

<dropzone
    id="dropzone-upload"
    url="https://example.com/api/upload-image"
    v-on:vdropzone-success="showSuccess"
    :preview-template="template"
    :useCustomDropzoneOptions="true"
    :dropzoneOptions="{
        dictDefaultMessage: '<span class=\'icon icon-upload\'></span><br/>Dra filer hit for 氓 laste opp',
        headers: {
            Authorization: authHeader
        },
        showRemoveLink: false,
        acceptedFileTypes: 'image/*'
    }"
    :maxFileSizeInMB="10"
    :createImageThumbnails="false"
>
</dropzone>

I have the exact same issue as above. This is my markup when calling the component within another component. In my case the dictDefaultMessage is never read.

@ellefsen Change your component to as below. You need to add dictDefaultMssage under language key. Give shot to following code and let me know if same issue persists.

Note : Also no need to provide icon in default message now. :tada:

<dropzone
    id="dropzone-upload"
    url="https://example.com/api/upload-image"
    v-on:vdropzone-success="showSuccess"
    :preview-template="template"
    :useCustomDropzoneOptions="true"
    :dropzoneOptions="{
        language: {
            dictDefaultMessage: '<span class=\'icon icon-upload\'></span><br/>Dra filer hit for 氓 laste opp'
        },
        headers: {
            Authorization: authHeader
        },
        showRemoveLink: false,
        acceptedFileTypes: 'image/*'
    }"
    :maxFileSizeInMB="10"
    :createImageThumbnails="false"
>
</dropzone>

Perfect. That did it for me this time. From the docs I would read it as if language should be a separate prop instead of being a part of the dropzoneOptions object. I found that a bit confusing.

See vue-dropzone/README.md - line 72

The language wrapper is no longer needed or valid. It is now simply:

dropzoneOptions: {
  dictDefaultMessage: 'Drop a PDF file here, or click to select a file to upload.'
}

Providing the language wrapper causes the entire thing to be ignored.

187

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dainemedia picture dainemedia  路  4Comments

stevenhardy-digital picture stevenhardy-digital  路  4Comments

bruno-fernandes picture bruno-fernandes  路  4Comments

demonmind picture demonmind  路  5Comments

ServerJunge picture ServerJunge  路  5Comments