📜  将类名添加到正文 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:53.203000             🧑  作者: Mango

代码示例1
openModal = (event) => {
  document.body.classList.add('modal-open');
  this.setState({ showModal: true });
}
hideModal = (event) => {
  document.body.classList.remove('modal-open');
  this.setState({ showModal: false });
}