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> ) } }
时间: 2024-12-20 14:46:39