我正在使用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對不起錯誤的演示網址添加。更新它剛剛 –
你知道如何確保內容不會被推下面板下嗎? –