axios請求失?。ň蜎]開始跨域請求)
我在 main.js 內引用 axios
import?Vue?from?'vue' import?App?from?'./App.vue' import?router?from?'./router' import?axios?from?'axios' import?VueAxios?from?'vue-axios' Vue.use(axios,VueAxios) Vue.prototype.$http=axios?//$http?名字是自定義,也可以使用$axios?$a Vue.config.productionTip?=?false new?Vue({ ??router, ??render:?h?=>?h(App) }).$mount('#app')
console.log() 沒有日志輸出。 注釋掉 this.$http 能夠顯示出第26行的打印。