1.0.83 • Published 3 years ago

@iwux/uploader v1.0.83

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

usage

{ "usingComponents": { "wux-uploader": "@iwux/uploader" } }

Page({ data: { uploaderConfigs: { maxCount: 5, title: '图片上传', tips: '图片上传提示', files: { url: 'https://abc.png', }, uploadFunc: null, }, }, onLoad() { const { uploaderConfigs } = this.data; uploaderConfigs.uploadFunc = this.uplaodFile.bind(this); this.setData({ uploaderConfigs }); }, uplaodFile(files) { console.log('== uplaodFile', files); return new Promise((resolve, reject) => { setTimeout(() => { reject({ message: '上传失败,请稍后再试' }); }, 1000); }); }, uploadError(e) { console.log('== upload error', e.detail); }, uploadSuccess(e) { console.log('== upload success', e.detail); }, onDelete(e) { console.log('== onDelete', e.detail); }, });