vue在页面加载时触发的函数
作者:互联网
//页面加载时触发的函数
methods: {
getEmp: function() {
// console.log(this.joke);
var that = this;
axios.post("http://localhost:8080/allEmp"
).then(function(response) {
console.log(response.data);
that.emps = response.data;
// console.log(that.emps);
}, function(err) {
console.log(err);
})
},
},
mounted:function(){
this.getEmp();
}
标签:function,vue,console,log,getEmp,emps,加载,response,页面 来源: https://www.cnblogs.com/maomao777/p/16084734.html