vue 项目中 点击回车键 自动登录

看到有些人写的比较好  就转载了网址  https://blog.csdn.net/julying/article/details/83587370  回车登录

  https://blog.csdn.net/julying/article/details/83587370  回车登录网址

  https://blog.csdn.net/julying/article/details/83587370  回车登录

2.当验证码不正确的时候,自动更新验证码图片

 //这个是图片验证码的函数

CodeImg() {
let num = Math.ceil(Math.random() * 100);
this.vsCode = `${process.env.API_ROOT}/api/account/authcode?num=${num}`;  路径+随机数
},
在需要验证码更新的地方,调用这个方法
注意:区分点击事件,不能直接调用点击事件,要将点击事件里面的函数单独写,再以点击事件调用,只能将事件单独写,然后再调用,都要这样写;;
//点击刷新验证码
changeCodeImg(){ //这里是点击验证码图片的时候会刷新验证码
this.CodeImg();
},
原文地址:https://www.cnblogs.com/maibao666/p/11232656.html