課程
/前端開發(fā)
/Vue.js
/vue-cli全集
和老師的代碼一樣,不知道錯(cuò)在哪里了,誰幫忙看看啊
2020-05-11
源自:vue-cli全集 4-13
正在回答
我的版本和老師的不同,找到node_modules/axios里面的README.md
根據(jù)里面的用法,我用下面這段可以正常顯示圖片了:
const axios = require("axios");
axios.get("json/phone.json").then(function(response) {
obj.list = response.data;
})
.catch(function(error) {
.then(function() {
});
看看main.js里 你全局定義的名字是否是 $http? 像我全局定義的時(shí)候? 使用的是axios? 這里ajax獲取數(shù)據(jù)的時(shí)候 就需要用$axios
舉報(bào)
手把手帶你學(xué)習(xí)從項(xiàng)目創(chuàng)建到項(xiàng)目升級(jí),完美契合企業(yè)需求
1 回答網(wǎng)頁提示"TypeError: Cannot read property 'get' of undefined"
1 回答Cannot read property 'indexOf' of undefined(這個(gè)報(bào)的是什么錯(cuò)?。?/p>
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2021-06-18
我的版本和老師的不同,找到node_modules/axios里面的README.md
根據(jù)里面的用法,我用下面這段可以正常顯示圖片了:
const axios = require("axios");
axios.get("json/phone.json").then(function(response) {
obj.list = response.data;
})
.catch(function(error) {
})
.then(function() {
});
2020-05-18
看看main.js里 你全局定義的名字是否是 $http? 像我全局定義的時(shí)候? 使用的是axios? 這里ajax獲取數(shù)據(jù)的時(shí)候 就需要用$axios