Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

wox-admin-upload

1.0.15 • Public • Published

Upload image

配合 ant-form getFieldDecorator 使用,initialValue值为 String(单图) 或 Array(多图)类型

API

属性 说明 类型 默认值
imgType 图片类型 Array ['jpg', 'png', 'jpeg', 'gif']
imgSize 图片大小,单位为 KB Number 1024
action 图片上传接口 String
max 图片上传最大数,>1 为多图模式,默认为单图模式 Number 1

Usage

import WoxUpload from 'wox-admin-upload';
 
<FormItem>
  {getFieldDecorator('logoUrl', {
    rules: [{
      required: true, message: 'Please upload your logo'
    }],
    initialValue: curData.logoUrl || '',
  })(
    <WoxUpload
      max={1}
      imgType={['png']}
      imgSize={1024}
      action={`${Base.img}/wximg/dppLogo/upload`}
    />
    // 单图一般 <WoxUpload action={`${Base.img}/wximg/dppLogo/upload`}/> 即可
  )}
</FormItem>

install

npm i wox-admin-upload

Downloadsweekly downloads

41

version

1.0.15

license

MIT

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability