| | |
| | | return {} |
| | | } |
| | | }, |
| | | sourceType: { |
| | | type: Number, |
| | | }, |
| | | options: { |
| | | type: Object, |
| | | default() { |
| | |
| | | } |
| | | }, |
| | | filesAdded(files, fileList) { |
| | | if (this.sourceType == 3 && files[0]) { |
| | | if ( |
| | | !files[0].name.endsWith(".tar") || |
| | | !files[0].name.endsWith(".gz") || |
| | | !files[0].name.endsWith(".tar.gz") |
| | | ) { |
| | | this.shouldStop = true |
| | | return |
| | | } |
| | | } |
| | | this.$emit(kebabCase(FILES_ADDED_EVENT), files, fileList) |
| | | if (files.ignored || fileList.ignored) { |
| | | // is ignored, filter it |
| | |
| | | this.fileList = this.uploader.fileList |
| | | }, |
| | | filesSubmitted(files, fileList) { |
| | | if (this.sourceType == 3&& files[0]) { |
| | | if ( |
| | | !files[0].name.endsWith(".tar") || |
| | | !files[0].name.endsWith(".gz") || |
| | | !files[0].name.endsWith(".tar.gz") |
| | | ) { |
| | | this.shouldStop = true |
| | | return |
| | | } |
| | | } |
| | | this.files = this.uploader.files |
| | | this.fileList = this.uploader.fileList |
| | | if (this.autoStart) { |
| | |
| | | } |
| | | }, |
| | | allEvent(...args) { |
| | | console.log(args) |
| | | const name = args[0] |
| | | const EVENTSMAP = { |
| | | [FILE_ADDED_EVENT]: true, |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | // console.log('uploader attrs',this.attrs); |
| | | // this.bindUploader(); |
| | | this.options.initialPaused = !this.autoStart |
| | | const uploader = new Uploader(this.options) |