gap-front-uploader
v1.1.7
Published
1.install ``` npm i gap-front-uploader ```
Downloads
36
Readme
Quick start
1.install
npm i gap-front-uploader
2.import
import {Uploader} from 'gap-front-uploader';
3.setting
let sketchOpts = {
captain: '上传图片',
mainClass: '',
descPlaceholder: 'descPlaceholder',
onCompress: (size) => {
return 1;
},
folder: 'image',
format: ['image/gif', 'image/png', 'image/jpeg', 'image/jpg', 'image/bmp', 'video/*'],
domain: 'http://ovsst1s46.bkt.clouddn.com/',
defaultImg: '//stt1.ideapar.com/img/upload.png',
fetchUpToken: '//file.icl.main/qiniu/token',
createFile: '//file.icl.main/open/files',
listFile: '//file.icl.main/open/files',
listCat : '//file.icl.main/open/cats',
onUploadError: () => {
console.error('upload error')
}
};
4.container setting
zview({
'.upload-sketch-form': Uploader,
});
5.get View instance
let uploadSketchForm = zview.view('.upload-sketch-form');
6.get Return value
uploadSketchForm.onSubmitted = data => {
console.log(data);
}