【发布时间】:2018-08-03 09:07:18
【问题描述】:
我有一个对象,我将使用 axios 在发布请求中使用它
employee:{
name: 'test',
email: 'test@gmail.com',
password: '123456',
role: {
created_at:"2018-08-03 07:34:30"
deleted_at:null
id:2
role_name:"employee"
updated_at:"2018-08-03 07:34:30"
}
},
这是我的发帖请求
axios.post('api/employees', vm.employee)
.then( response => {
alert("Employee Inserted");
vm.errors.clear();
vm.setFalse();
vm.fetchEmployees();
})
.catch( error => {
vm.errors.record(error.response.data);
});
如何在 post 请求中只传递角色对象中的角色名称以及名称、电子邮件和密码
【问题讨论】:
标签: javascript vue.js vuejs2