使用axios模块发送ajax请求,先在项目里安装组件依赖库 npm install axios --save
然后在项目里用Vue设置一下,Vue.prototype.$axios=axios
1 if(ret.data.code===1000){
2 that.courseList=ret.data.data;
3 // console.log(ret.data)
4 }
三个等于号表示类型和值都相等