localStorage存放数据自动转为String字符串,重新获取Boolean时非空字符串都为true。
解决方法:在存放时,如果为false,则设置空字符串;
localStorage.setItem('rememberPwd', this.rememberPwd ? 'true' : '')
localStorage存放数据自动转为String字符串,重新获取Boolean时非空字符串都为true。
解决方法:在存放时,如果为false,则设置空字符串;
localStorage.setItem('rememberPwd', this.rememberPwd ? 'true' : '')