Dropzone.js删除"删除文件或点击上传。"文件上传时

时间:2016-05-19 17:18:46

标签: dropzone.js

如何删除说明文字"在此处删除文件或点击上传。"什么时候上传文件?我已经在下面展示了一些屏幕截图。

默认 - 无文件(用于演示目的)

Default - no file

默认 - 上传文件(我想要的行为)

Default - with file

我的 - 没有文件

Mine - no file

我的 - 上传文件(我不想要文字)

Mine - with file

CSS

.dropzone {
    border: none !important;
    border-radius: 5px;
    padding: 0 !important;
    background: white !important;
    min-height: 200px !important;
    width: 100%;
    margin-bottom: 20px;
    line-height: 200px;
    vertical-align: middle;
    color: #263238;
    text-align: center !important;
}

的Javascript

$(document).bind('drop dragover', function (e) {
    e.preventDefault();
});

Dropzone.autoDiscover = false;

var myvue = new Vue({
    el: 'body',

    ready: function () {
        var dropzone = new Dropzone(document.body, {
            url: "/api/import",
            previewsContainer: ".dropzone",
            clickable: ".dropzone",
            init: function () {
                this.on("success", function (file, response) {
                    console.log(file);
                    console.log(response);
                });
            },
            paramName: "file", // The name that will be used to transfer the file
            maxFilesize: 4, // MB
            acceptedFiles: ".csv",
            uploadMultiple: false,
            maxFiles: 1,
            headers: {
                'X-CSRF-Token': $('meta[name="token"]').attr('content')
            }
        });
    }
});

0 个答案:

没有答案
相关问题