Skip to content

请教个问题,无法登录 #1

@lh333sunshine

Description

@lh333sunshine

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,跳转时报错

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions