我正在尝试为我的项目实现 React Modal。我想将模态标题和模态按钮居中。我尝试使用 flex 和 just-content-center 但它不起作用。任何建议都很有价值。
<Modal show={modalShow} onHide={this.handleClose} aria-labelledby="contained-modal-title-vcenter" centered>
<Modal.Header closeButton>
<div className="d-flex justify-content-center">
<Modal.Title>{isVerified?"Submitted succesfully":"Failed to submit"}</Modal.Title>
</div>
</Modal.Header>
<Modal.Footer>
<Button variant={`${isVerified == false?"danger ":"success"}`} onClick={this.handleClose} centered>
{isVerified?"Ok":"Try again"}
</Button>
</Modal.Footer>
</Modal>
Run Code Online (Sandbox Code Playgroud) 我想在Nextjs中基本检测运行环境是dev还是production。有没有直接的方法可以做到这一点?
if(env == "dev"){
// do something
}
else if (env == "prod"){
// do something
}
Run Code Online (Sandbox Code Playgroud)