diff --git a/docs/demo/dragDirectory.md b/docs/demo/dragDirectory.md new file mode 100644 index 0000000..63767ab --- /dev/null +++ b/docs/demo/dragDirectory.md @@ -0,0 +1,8 @@ +--- +title: dragDirectory +nav: + title: Demo + path: /demo +--- + + diff --git a/docs/examples/dragDirectory.tsx b/docs/examples/dragDirectory.tsx new file mode 100644 index 0000000..487e323 --- /dev/null +++ b/docs/examples/dragDirectory.tsx @@ -0,0 +1,44 @@ +/* eslint no-console:0 */ +import React from 'react'; +import Upload from 'rc-upload'; + +const props = { + action: '/upload.do', + type: 'drag', + directory: true, + beforeUpload(file, fileList) { + console.log('beforeUpload', file.name, fileList); + }, + onStart: file => { + console.log('onStart', file.name); + }, + onSuccess(file) { + console.log('onSuccess', file); + }, + onProgress(step, file) { + console.log('onProgress', Math.round(step.percent), file.name); + }, + onError(err) { + console.log('onError', err); + }, + style: { display: 'inline-block', width: 200, height: 200, background: '#eee' }, + // openFileDialogOnClick: false +}; + +const Test = () => { + return ( +
+
+ + 开始上传 + +
+
+ ); +}; + +export default Test;