慕尼黑8203826
2019-10-05 11:59
data() { return { count: 0, isReg: false, name: '', password: '', repeat: '' } }, methods: { login: function () { if (localStorage.getItem('name') == this.name && localStorage.getItem('password') == this.password) { this.$router.push('/home') } else { alert('用户名或者密码错误') } }, reg: function () { this.isReg = true//赋值无效 this.count++ },
你确定你的reg方法执行了吗?
有没有debug过?
这里可以这么样赋值啊!
3小时速成 Vue2.x 核心技术
82574 学习 · 489 问题
相似问题