1. Multi-select box control, set the v-model attribute, v-model="checked"
<el-checkbox v-model="checked" class="login-remember">记住密码</el-checkbox>
2. Declare the checked control in data, the default is unchecked,
export default {
name: 'Login',
data() {
return{
checked:false,//默认是否记住密码
}
}
}
3.
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.)
Tips: Encryption processing, paste a piece of code here, test it yourself