Vue.js
1created() { 2 axios 3 .get('https://api.coindesk.com/v1/bpi/currentprice.json') 4 .then(response => (this.info = response)) 5 .catch(error => { 6 console.log(error) 7 this.errored = true 8 }) 9 }
フォルダの中のJSONを参照すると404エラーが返ってきます。
Error: "Request failed with status code 404"
Vue.js
1created() { 2 axios 3 .get('@/currentprice.json') 4 .then(response => (this.info = response)) 5 .catch(error => { 6 console.log(error) 7 this.errored = true 8 }) 9 }
Vue-cliでaxiosを使うにはjsonデータをどう指定したらいいでしょうか?
ぜひ教えてください・
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/10/13 03:43