为了账号安全,请及时绑定邮箱和手机立即绑定

Variabel 未在方法 VueJs 中定义

Variabel 未在方法 VueJs 中定义

慕后森 2021-06-28 13:59:24
我一直在 VueJs 方法中定义一个对象,并希望将该对象用于 axios,如下所示:data() {         return {             name : '',             password: '',             email: ''         }     },     methods: {         submit() {             sendData = {                 name: this.name,                 password: this.password,                 email: this.email             }             axios.post('http://localhost:8000/api/users', sendData)             .then(response => {                 console.log(response);             })             .catch(error => {                 console.log(error)             })         }     }输出是 ReferenceError: sendData is not defined
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 175 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信