1、cnpm install axios --save
2、全局默认axios:
2、全局axios:
Vue.prototype.$axios = axios
还要添加一句:
axios.defaults.headers.post[‘Content-Type’] = ‘application/x-www-form-
urlencoded’;
也就是下面这句:
Vue的axios全局安装
最新推荐文章于 2024-08-04 02:06:11 发布
1、cnpm install axios --save
2、全局默认axios:
2、全局axios:
Vue.prototype.$axios = axios
还要添加一句:
axios.defaults.headers.post[‘Content-Type’] = ‘application/x-www-form-
urlencoded’;
也就是下面这句: