How to remember the password on the login page?

log in page
1. Multi-select box control, set the v-model attribute, v-model="checked"

 <el-checkbox v-model="checked" class="login-remember">记住密码</el-checkbox>

insert image description here
2. Declare the checked control in data, the default is unchecked,

 export default {
    
    
    name: 'Login',
    data() {
    
    
    return{
    
    
   		 checked:false,//默认是否记住密码
		}
	}
}

![](https://img-blog.csdnimg.cn/ea2b4774a05647839b459bd0c9362fda.pn
3.
insert image description here
4. Here, I use the localStorage method to store the password. You can see the password in the console page - - >Application - - >Local Storage - - >pwd (I have not encrypted, and the general password must be done Encryption processing is better, learn by yourself here, so I won’t deal with it.)
insert image description here
Tips: Encryption processing, paste a piece of code here, test it yourself
insert image description here

insert image description here

Guess you like

Origin blog.csdn.net/weixin_43778617/article/details/127924266