标签:
import React, {PropTypes} from ‘react‘; export default class Test extends React.Component { constructor(props) { super(props); this.state = { webUploader:null, showDialog:false, selectFiles:[] }; this.uploadConfig={}; } componentDidMount(){ } uploaderDidMount(webUploader){ this.setState({webUploader:webUploader}); } onSelectedImageFile(files){ this.setState({ selectFiles:files, showDialog:true }); } render(){ return ( <div> <Dialog show={this.state.showDialog} selectFiles={this.state.selectFiles} uploader={this.state.webUploader}></Dialog> <UploaderButton className="fileUploader" config={this.uploadConfig} uploaderDidMount={this.uploaderDidMount}> <div>点击上传</div> </UploaderButton> </div> ) } }
标签:
原文地址:http://www.cnblogs.com/lhp2012/p/5808230.html