Vue.js とaxoisを使用して、通信しようとすると、
以下のエラーが表示されます。
vue.min.js:6 ReferenceError: axois is not defined
at hn.mounted (vue:15)
at _t (vue.min.js:6)
at hn.$mount (vue.min.js:6)
at hn.$mount (vue.min.js:6)
at hn._init (vue.min.js:6)
at new hn (vue.min.js:6)
at vue:10
HTML
1<html> 2 <body> 3 <div id="app"> 4 <table></table> 5 </div> 6 <script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.min.js"></script> 7 <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.min.js"></script> 8 <script> 9 10 new Vue({ 11 el: '#app', 12 mounted() { 13 var url = '/test/json'; 14 15 axois.get(url).then(function(response) { 16 var data = response.data; 17 console.log(data); 18 }); 19 } 20 }); 21 22 </script> 23 </body> 24</html>
CDNが間違っているのでしょうか?
どうかよろしくお願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/04/16 07:37