区别就是前者是ES5写法,后者是ES6写法
methods:{
//ES5
getData: function (){
}
//ES6
getData() {
this.axios({
method: 'get',
url: '/data.json'
}).then(function (repos) {
console.log(repos);
}).catch(function (error) {
console.log(error);
});
}
} 
京公网安备 11010502036488号