1.0.4 • Published 7 years ago

wox-admin-upload-files v1.0.4

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

wox-react-component image

API

属性说明类型默认值
action图片上传接口String
data上传接口参数Object
style样式Object
max图片上传最大数,>1 为多图模式,默认为单图模式Number1
text拖拽框文案描述String
onChange返回数据回调Function(value):Object

Usage

import WoxUploadFiles from 'wox-admin-upload-files';

render(
  <WoxUploadFiles 
    action={`//upload.woqu.com/upload`}
    text='将文件拖入框中'
    max='100'
    onChange={this.uploadChange}
    value={data.attachmentElemList}
    data={{
      type: 'xorder',
      role: 'admin'
    }}
  />,
  rootEle
);

可以配合 getFieldDecorator 使用

import WoxUploadFiles from 'wox-admin-upload-files';

render(
  <FormItem {...formLayout} label={'上传供应商 Invoice:'}>
    {getFieldDecorator('invoiceUrl', {
      initialValue: '',
    })(
      <WoxUploadFiles 
        action={`//upload.woqu.com/upload`}
        text='将文件拖入框中,或点击选择文件,支持格式:PDF、JPG、PNG'
        data={{
          type: 'xorder',
          role: 'admin'
        }}
      />
    )}
  </FormItem>,
  rootEle
);