2.2.3 • Published 6 years ago

react-core-image-upload v2.2.3

Weekly downloads
13
License
MIT
Repository
github
Last release
6 years ago

react-core-image-upload

npm Node Version Build Status

A component for image to upload and crop

Document

中文文档

Install

Use Npm

npm install react-core-image-upload --save

Use yarn

yarn add react-core-image-upload

How to use

import React from 'react';
import ReactCoreImageUpload  from 'react-core-image-upload';
let App = React.createClass({
//...

  render() {
    return(
      <div>
        <ReactCoreImageUpload
          text="Upload Your Image"
          className='pure-button'
          inputOfFile="files"
          url="./api/upload.php"
          imageUploaded={this.handleRes}>
        </ReactCoreImageUpload>
      </div>
    );
  },

  handleRes(res) {
    this.setState({
      // handle response
    })
  }
})

Run demo

cd __sites_ && npm run start

http://localhost:9000/webpack-dev-server/demo/index.html

Demos

Props

Events

  • imageUploaded: when you finish your image uploading
  • imageChanged: when the input file has changed
  • imageUploading when your image is uploading
  • errorHandle when image uploading meet some error

Demo

Demo Source

Contributions

Your contributions and suggestions are welcome 😄😄😄💐💐💐

2.2.3

6 years ago

2.2.2

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

0.9.6

8 years ago

0.9.5

8 years ago