質問編集履歴

1

脱字の修正

2021/04/05 04:04

投稿

rgb_nk
rgb_nk

スコア26

test CHANGED
File without changes
test CHANGED
@@ -126,29 +126,19 @@
126
126
 
127
127
  ```javascript
128
128
 
129
- import { defineComponent, onMounted, ref } from "@vue/composition-api";
130
-
131
- import axios from "axios";
132
-
133
129
  export default defineComponent({
134
130
 
135
131
  name: 'App',
136
132
 
137
133
  setup() {
138
134
 
139
- var shopInfos=ref([]);
135
+ const shopInfos = axios
140
-
141
- onMounted(() => {
136
+
142
-
143
- axios
144
-
145
- .get("エンドポイント")
137
+ .get("http://127.0.0.1:8000/api/posregister/")
146
-
138
+
147
- .then((response) => shopInfos.value = response.data);
139
+ .then((response) => {return response.data});
148
-
140
+
149
- console.log(shopInfos)
141
+ console.log(shopInfos)
150
-
151
- })
152
142
 
153
143
  return {
154
144