详解vue中axios的封装

2020-06-13 10:47:53易采站长站整理

Vue.prototype.$put=put;

最后在组件里直接使用


mounted(){
this.$fetch('/api/v2/movie/top250')
.then((response) => {
console.log(response)
})
},

其余的方法一样