码迷,mamicode.com
首页 > Web开发 > 详细

webUploader react 接口设计

时间:2016-08-25 21:14:23      阅读:735      评论:0      收藏:0      [点我收藏+]

标签:

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>
        )
    }

}

  

webUploader react 接口设计

标签:

原文地址:http://www.cnblogs.com/lhp2012/p/5808230.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!