Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
};
/**是否需要拖动上传*/
if (option.isDrop) {
config['drop_element'] = this.browseButton;
}
/**
* 配置上传类型
* array
* [{title: "Image files",extensions: 'gif,jpeg,jpg,png,bmp'}]
* */
if (option.mimeTypes) {
config.filters['mime_types'] = option.mimeTypes;
}
this.evueUploader = new plupload.Uploader(config);
this.evueUploader.init();
this.$emit('evueUploader', this.evueUploader)
},
startUp() {
constructor(selectorId, options){
this.selectorId = selectorId;
this.options = $.extend({
headers: {
},
onUploaded: (response, file) => {
},
onError: (error) => {
Util.dialog.message(error.code + ": " + error.message + '; ' + Translator.trans('upload.try_again_after_refresh'))
}
}, options);
this.uploader = new plupload.Uploader({
runtimes : 'html5,flash,silverlight,html4',
browse_button : selectorId,
url : Util.route.getRoutePath('upload'),
file_data_name: 'file',
filters : {
max_file_size : '2mb',
mime_types: [
{title : Translator.trans('upload.try_again_after_refresh'), extensions : "jpg,gif,png"}
]
},
headers: this.options.headers,
init: {
FilesAdded: function(uploader) {
uploader.start();
},
FileUploaded: (uploader, file, result) => {