質問編集履歴
5
'failure', 削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -58,7 +58,7 @@
|
|
58
58
|
|
59
59
|
}).catch(function (error) {
|
60
60
|
|
61
|
-
console.log(
|
61
|
+
console.log(error)
|
62
62
|
|
63
63
|
})
|
64
64
|
|
4
'failure', error追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -58,7 +58,7 @@
|
|
58
58
|
|
59
59
|
}).catch(function (error) {
|
60
60
|
|
61
|
-
console.log('failure')
|
61
|
+
console.log('failure', error)
|
62
62
|
|
63
63
|
})
|
64
64
|
|
3
main.jsとhtmlを大幅に変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,9 +18,9 @@
|
|
18
18
|
|
19
19
|
<div id="app2">
|
20
20
|
|
21
|
-
<select v-o
|
21
|
+
<select v-model="table_list_selected">
|
22
22
|
|
23
|
-
<option v-for="item in table_list"
|
23
|
+
<option v-for="item in table_list">{{ item }}</option>
|
24
24
|
|
25
25
|
</select>
|
26
26
|
|
@@ -42,15 +42,25 @@
|
|
42
42
|
|
43
43
|
el: '#app2',
|
44
44
|
|
45
|
-
data: {
|
45
|
+
data: () => ({
|
46
46
|
|
47
|
-
table_list:
|
47
|
+
table_list: '',
|
48
48
|
|
49
|
-
|
49
|
+
table_list_selected: ''
|
50
50
|
|
51
|
-
|
51
|
+
}),
|
52
52
|
|
53
|
+
created: function () {
|
54
|
+
|
55
|
+
axios.get('API').then(response => {
|
56
|
+
|
57
|
+
this.table_list = response.data
|
58
|
+
|
59
|
+
}).catch(function (error) {
|
60
|
+
|
53
|
-
|
61
|
+
console.log('failure')
|
62
|
+
|
63
|
+
})
|
54
64
|
|
55
65
|
}
|
56
66
|
|
2
質問文を修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,17 +16,15 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
-
|
19
|
+
<div id="app2">
|
20
20
|
|
21
|
-
<select v-
|
21
|
+
<select v-on:change="selected">
|
22
22
|
|
23
23
|
<option v-for="item in table_list" :value="item">{{ item }}</option>
|
24
24
|
|
25
25
|
</select>
|
26
26
|
|
27
|
-
<div>{{ selected_table }}</div>
|
28
|
-
|
29
|
-
|
27
|
+
</div>
|
30
28
|
|
31
29
|
|
32
30
|
|
@@ -54,8 +52,6 @@
|
|
54
52
|
|
55
53
|
this.table_list = (await axios.get('APIのURL'))
|
56
54
|
|
57
|
-
this.selected_table = this.table_list
|
58
|
-
|
59
55
|
}
|
60
56
|
|
61
57
|
})
|
1
this.table_list[0].idをthis.table_listに変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,13 +18,13 @@
|
|
18
18
|
|
19
19
|
<div id="app2">
|
20
20
|
|
21
|
-
<select v-model="selected_table
|
21
|
+
<select v-model="selected_table" v-on:change="selected">
|
22
22
|
|
23
|
-
<option v-for="item in table_list" :value="item">{{ item
|
23
|
+
<option v-for="item in table_list" :value="item">{{ item }}</option>
|
24
24
|
|
25
25
|
</select>
|
26
26
|
|
27
|
-
<div>{{ selected_table
|
27
|
+
<div>{{ selected_table }}</div>
|
28
28
|
|
29
29
|
</div>
|
30
30
|
|
@@ -54,7 +54,7 @@
|
|
54
54
|
|
55
55
|
this.table_list = (await axios.get('APIのURL'))
|
56
56
|
|
57
|
-
this.selected_table
|
57
|
+
this.selected_table = this.table_list
|
58
58
|
|
59
59
|
}
|
60
60
|
|