项目场景:
用VScode写vue框架的前端
用idea写后端, 然后实现前后端交互的增删改查
问题描述:
第一个bug:
报错
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.company.dao.IUserDao.addUser
第二个bug: 代理不生效 , 依然访问/api/xxx, 然后报404
module.exports = {
lintOnSave:false,
devServer:{
// 改端口
port:8081,
proxy: {
"/api": {
target: "http://localhost:8080",
changeOrigin: true,
pathRewrite: {
"^/api": "/student_web1025"
}
}
}
}
}
第三个:
报错:vue.runtime.esm.js?2b0e:619 [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop’s value. Prop being mutated: “students”
found in
—> at src/components/SelectComponent.vue
at src/pages/Student.vue
at src/pages/Manage.vue
at src/App.vu
methods: {
async find(){
let r = await dofind(this.studentname);
console.log(r);
this.students = r.data;
}
},
原因分析:
第一个肯定是xml没写对
第二个我觉得我全写对了, 不知道为啥
第三个看报错得知父类的属性不能直接在子类改, 应该是用$emit调父类方法改
解决方案:
第一个:
Xml里面的id属性没写
第二个: 重启了vue终端服务器就好了…
第三个: 父类写v-model , 然后子类调方法改属性
methods: {
async find(){
let r = await dofind(this.studentname);
console.log(r);
// this.students = r.data;
this.$emit("input",r.data)
}
},