File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 147147 webkitdirectory: {
148148 type: Boolean ,
149149 default: false
150- }
150+ },
151+ httpRequest: {
152+ type: Function ,
153+ default: ajax
154+ },
151155 },
152156 data () {
153157 return {
250254 let formData = new FormData ();
251255 formData .append (this .name , file);
252256
253- ajax ( {
257+ const options = {
254258 headers: this .headers ,
255259 withCredentials: this .withCredentials ,
256260 file: file,
266270 onError : (err , response ) => {
267271 this .handleError (err, response, file);
268272 }
269- });
273+ };
274+ const req = this .httpRequest (options);
275+ if (req && req .then ) {
276+ req .then (options .onSuccess , options .onError );
277+ }
270278 },
271279 handleStart (file ) {
272280 file .uid = Date .now () + this .tempIndex ++ ;
You can’t perform that action at this time.
0 commit comments