react-upload-smms
React upload for smms
properties:
static propTypes = {
className: PropTypes.string,
onChange: PropTypes.func,
};
static defaultProps = {
onChange: noop
};
install && import:
npm install --save afeiship/react-upload-smms --registry=https://registry.npm.taobao.org
import ReactUploadSmms from 'react-upload-smms';
// customize your styles:
$react-upload-smms-options:(
);
@import 'node_modules/react-upload-smms/dist/style.scss';
use sm.ms/api/upload
usage:
// install: npm install afeiship/react-upload-smms --save
// import : import ReactUploadSmms from 'react-upload-smms'
class App extends React.Component{
state = {
};
constructor(props){
super(props);
window.demo = this;
window.refs = this.refs;
window.rc = this.refs.rc;
}
_onChange = e =>{
console.log(e.target.value);
};
render(){
return (
<div className="hello-react-upload-smms">
<ReactUploadSmms onChange={this._onChange} ref='rc' />
</div>
);
}
}