# comp-upload

> basic react component

Latest version **1.0.3** (published 2019-05-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install comp-upload
pnpm add comp-upload
yarn add comp-upload
bun add comp-upload
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-05-22 |
| First published | 2019-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 19.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | newyoung21 |
| Keywords | react, component |

## Links

- npm: https://www.npmjs.com/package/comp-upload
- npm.io page: https://npm.io/package/comp-upload

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2019-05-22
- 1.0.2 — 2019-05-07
- 1.0.1 — 2019-04-29

## README

# comp-upload [![image](https://img.shields.io/npm/v/comp-upload.svg)](https://www.npmjs.com/package/comp-upload)
> 配合 ant-form getFieldDecorator 使用，initialValue值为 String(单图) 或 Array(多图)类型

## API

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

## Usage

```javascript
import CompUpload from 'wox-admin-upload';

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

---
_Source: https://npm.io/package/comp-upload · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
