烙印99
不建议使用style进行样式的控制,可以定义.topic-intro-extended来修改max-height为auto, .fold也是同理var Component = React.createClass({ getInitialState:function(){ return { topicExtended:false } }, toggleClickHandler:function(){ this.setState({ topicExtended:!this.state.topicExtended }); }, render:function(){ var topicCls = "topic-intro"; var foldCls = ""; if(this.state.topicExtended){ topicCls+=" topic-intro-extended"; foldCls+="fold"; } return (
blablabla
blablabla
click me