📜  反应保存到本地存储 - Javascript代码示例

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

代码示例3
handleFormSubmit = () => {
  const { user, rememberMe } = this.state;
  localStorage.setItem('rememberMe', rememberMe);
  localStorage.setItem('user', rememberMe ? user : '');
};