import React from "react";
import styled from "./index.module.css";
interface Props {}
interface State {
isOpen: boolean;
}
class Modal extends React.Component<Props, State> {
constructor(props: Props) {
super(props);
this.state = {
isOpen: false,
};
}
render() {
return (
<div className={styled.container}>
<button
className={styled.button}
onClick={() => {
this.setState({ isOpen: !this.state.isOpen });
}}
>
显示
</button>
<div
className={styled.dropDown}
style={{
display: this.state.isOpen ? "block" : "none",
}}
>
</div>
</div>
);
}
}
export default Modal;