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 147
147
webkitdirectory: {
148
148
type: Boolean ,
149
149
default: false
150
- }
150
+ },
151
+ httpRequest: {
152
+ type: Function ,
153
+ default: ajax
154
+ },
151
155
},
152
156
data () {
153
157
return {
250
254
let formData = new FormData ();
251
255
formData .append (this .name , file);
252
256
253
- ajax ( {
257
+ const options = {
254
258
headers: this .headers ,
255
259
withCredentials: this .withCredentials ,
256
260
file: file,
266
270
onError : (err , response ) => {
267
271
this .handleError (err, response, file);
268
272
}
269
- });
273
+ };
274
+ const req = this .httpRequest (options);
275
+ if (req && req .then ) {
276
+ req .then (options .onSuccess , options .onError );
277
+ }
270
278
},
271
279
handleStart (file ) {
272
280
file .uid = Date .now () + this .tempIndex ++ ;
You can’t perform that action at this time.
0 commit comments