我正在使用reactbootstrap并试图创建这个codepen让它工作,但没有运气sofar。这是应该打开和关闭面板:如何让折叠面板工作?
import { Button } from 'react-bootstrap';
import { Panel } from 'react-bootstrap';
import { Fade} from 'react-bootstrap';
import { Collapse } from 'react-bootstrap';
class App extends React.Component {
constructor() {
super();
this.state = {};
}
render() {
return (
<div>
<Button onClick={()=> this.setState({ open: !this.state.open })}>
click
</Button>
<Collapse in={this.state.open}>
<div>
<Well>
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid.
Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
</Well>
</div>
</Collapse>
</div>
);
}
};
这是codepen 有在控制台中没有错误,所以不知道是怎么回事。
老兄,它不工作的演示? –
@bierhier对不起错误的演示网址添加。更新它刚刚 –
你知道如何确保内容不会被推下面板下吗? –