回答編集履歴
1
2 のサンプルコードをVueインスタンス内のコードであることが分かるよう修正
answer
CHANGED
@@ -31,7 +31,11 @@
|
|
31
31
|
Vue.prototype.$axios = axios;
|
32
32
|
|
33
33
|
// 2. in MyPage.vue
|
34
|
+
new Vue({
|
35
|
+
beforeCreate: () => {
|
34
|
-
this.$axios.get('/user').then( ~~~
|
36
|
+
this.$axios.get('/user').then( ~~~
|
37
|
+
},
|
38
|
+
});
|
35
39
|
```
|
36
40
|
|
37
|
-
もし参考になれば ????
|
41
|
+
Vueを普段書かないので 2 のサンプルコードが変かもしれませんが、もし参考になれば ????
|