-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
请教个问题,无法登录 #1
Comments
一样的问题,作者可以解释一下吗,新手不太明白啊 |
setup里面不能用this |
添加
import router from '@/router/index.js'
使用
router.push({path:'/layout'}) 就OK了 |
根本无法登陆 账号密码都是admin么 |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Login/index.vue
function handleSubmit() {
if (isTrimAction(userName.value) && isTrimAction(pwd.value)) {
let user = {userName:userName.value,pwd:pwd.value,time:new Date()}
localStorage.setItem('user',JSON.stringify(user))
state.store.commit('userFun',user)
this.$router.push({
path:'/layout'
})
return;
} else {
alert('请输账号密码')
}
}
其中 this.$router 为 undefine,跳转时报错
The text was updated successfully, but these errors were encountered: