elearning/Frontend-Learner/node_modules/quasar/dist/api/QUploader.json

1 line
14 KiB
JSON
Raw Normal View History

2026-01-13 10:46:40 +07:00
{"type":"component","meta":{"docsUrl":"https://v2.quasar.dev/vue-components/uploader"},"props":{"factory":{"type":"Function","tsType":"QUploaderFactoryFn","desc":"Function which should return an Object or a Promise resolving with an Object; For best performance, reference it from your scope and do not define it inline","params":{"files":{"type":"Array","desc":"Uploaded files"}},"returns":{"type":["Object","Promise<any>"],"desc":"Optional configuration for the upload process; You can override QUploader props in this Object (url, method, headers, formFields, fieldName, withCredentials, sendRaw); Props of these Object can also be Functions with the form of (file[s]) => value"},"category":"upload"},"url":{"type":["String","Function"],"desc":"URL or path to the server which handles the upload. Takes String or factory function, which returns String. Function is called right before upload; If using a function then for best performance, reference it from your scope and do not define it inline","examples":["'https://example.com/path'","files => `https://example.com?count=${ files.length }`"],"params":{"files":{"type":"Array","desc":"Uploaded files"}},"returns":{"type":"String","desc":"URL or path to the server which handles the upload"},"category":"upload"},"method":{"type":["String","Function"],"default":"'POST'","desc":"HTTP method to use for upload; Takes String or factory function which returns a String; Function is called right before upload; If using a function then for best performance, reference it from your scope and do not define it inline","values":["'POST'","'PUT'"],"examples":["'POST'","files => (files.length > 10 ? 'POST' : 'PUT')"],"params":{"files":{"type":"Array","desc":"Uploaded files"}},"returns":{"type":"String","desc":"HTTP method to use for upload"},"category":"upload","required":false},"field-name":{"type":["String","Function"],"desc":"Field name for each file upload; This goes into the following header: 'Content-Disposition: form-data; name=\"__HERE__\"; filename=\"somefile.png\"; If using a function then for best performance, reference it from your scope and do not define it inline","default":"file => file.name","examples":["'backgroundFile'","file => ('background' + file.name)"],"params":{"files":{"type":"File","desc":"The current file being processed"}},"returns":{"type":"String","desc":"Field name for the current file upload"},"category":"upload","required":false},"headers":{"type":["Array","Function"],"desc":"Array or a factory function which returns an array; Array consists of objects with header definitions; Function is called right before upload; If using a function then for best performance, reference it from your scope and do not define it inline","definition":{"name":{"type":"String","required":true,"desc":"Header name","examples":["'Content-Type'","'Accept'","'Cache-Control'"]},"value":{"type":"String","required":true,"desc":"Header value","examples":["'application/json'","'no-cache'"]}},"examples":["[ { name: 'Content-Type', value: 'application/json' }, { name: 'Accept', value: 'application/json' } ]","() => [ { name: 'X-Custom-Timestamp', value: Date.now() } ]","files => [ { name: 'X-Custom-Count', value: files.length } ]"],"params":{"files":{"type":"Array","desc":"Uploaded files"}},"returns":{"type":"String","desc":"An array consisting of objects with header definitions"},"category":"upload"},"form-fields":{"type":["Array","Function"],"desc":"Array or a factory function which returns an array; Array consists of objects with additional fields definitions (used by Form to be uploaded); Function is called right before upload; If using a function then for best performance, reference it from your scope and do not define it inline","definition":{"name":{"type":"String","required":true,"desc":"Field name","examples":["'Some field'"]},"value":{"type":"String","required":true,"desc":"Field value","examples":["'some-value'"]}},"examples":["[ { name: 'my-field', value: 'my-value' } ]","() => [ { name: 'my-field', value: 'my-value' } ]","files => [ { name: 'my-field', value: 'my-value' + files.length }