vue中axios解決跨域問題和攔截器使用

vue中axios不支持vue.use()方式聲明使用。 因此有兩種方法能夠解決這點:javascript 第一種: 在main.js中引入axios,而後將其設置爲vue原型鏈上的屬性,這樣在組件中就能夠直接 this.axios使用了php import axios from 'axios'; Vue.prototype.axios=axios; components:前端 this.axio
相關文章
相關標籤/搜索