凌的博客

您现在的位置是: 首页 > 前端学习 > Vue > 

Vue

Vue 获取ajax请求

2019-08-22 Vue 1054
var vue = new Vue({
	   el:"#app",
	   data:{
		  message:"" 
	   },
	   methods:{
		   getinfo:function(){
			   var _this = this
			   axios.post("request.php",this.form).then(function(response){
				   var data = response.data;
				   console.log(data.data);
				   _this.message = data.data;
			   })
			   .catch(function(error){
				   console.log(error);
			   });
		   }
	   }
	   
	   
});

进入实验室


文章评论

0条评论