1. 发送数据时,发生400错误
var formData = new FormData()
Object.keys(this.student).forEach(key => {
formData.append(key, this.student[key])
})
this.$axios.post('/student/add', formData)
.then(resp => {
this.$router.push('/student/list')
})
前端发送的数据是formData
后端接收数据出现问题
解决方案:去掉这个注解
2.vue项目run运行时,无法启动。
在自定义组件中,尽量不要使用options。会和utils.js中的options重名。在对自定义组件中的options进行Do Refactor改名时,一定要看一下是否影响到了其他组件中的内容。
3.返回上一页按钮
back(){
history.go(-1)
}