Vue 使用axios獲取數據
阿新 • • 發佈:2018-06-20
-s ID rom data com span div mil hit
Axios.get(api).then((response) => {//註意這裏改為箭頭函數避免this指向問題
this.list = response.data.result;
}).catch((error) => {
console.log(error);
})
}
}
}
</script>
axios 的使用
1、安裝 cnpm install axios --save
2、哪裏用哪裏引入axios
</script>
Vue 使用axios獲取數據