map外边能获取到吗
你这`` 多少感觉用的有点问题
提示:这里描述项目中遇到的问题:在利用this.$http方法发起请求时,却发现$http中的post是undefined
methods:{
// 点击重置对象 重置登录表单
resetLoginForm(){
// console.log(this);
this.$refs.loginFormRef.resetFields()
// console.log( this.$refs);
},
login() {
console.log(this);
this.$refs.loginFormRef.validate(async valid => {
console.log(valid);
if (!valid) return
// 如果为true则发起请求此时需要配包
const { data: res } = await this.$http.post('/login', this.loginForm)
console.log(res)
if (res.meta.code !== 200) return this.$message.error('登录失败!')
this.$message.success('登录成功')
})
}
}