質問編集履歴
2
コードの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -60,13 +60,19 @@
|
|
60
60
|
|
61
61
|
<h1> ToDoアプリ</h1>
|
62
62
|
|
63
|
+
<form @submit.prevent="addItem">
|
64
|
+
|
63
65
|
<input type="text" v-model.lazy="textInput">
|
64
66
|
|
65
|
-
<
|
67
|
+
<input type="submit" value="追加">
|
66
68
|
|
67
|
-
|
69
|
+
</form>
|
68
70
|
|
71
|
+
<p v-for="textInput in textInputs" :key="textInput">
|
72
|
+
|
73
|
+
{{ textInput }}
|
74
|
+
|
69
|
-
|
75
|
+
</p>
|
70
76
|
|
71
77
|
</div>
|
72
78
|
|
@@ -76,24 +82,32 @@
|
|
76
82
|
|
77
83
|
<script>
|
78
84
|
|
79
|
-
|
80
|
-
|
81
85
|
export default {
|
82
86
|
|
83
87
|
data() {
|
84
88
|
|
85
89
|
return {
|
86
90
|
|
87
|
-
textInputs: {
|
88
|
-
|
89
91
|
textInput: '',
|
90
92
|
|
91
93
|
}
|
92
94
|
|
95
|
+
},
|
96
|
+
|
97
|
+
methods: {
|
98
|
+
|
99
|
+
addItem: function(){
|
100
|
+
|
101
|
+
this.textInputs.push(this.textInput);
|
102
|
+
|
103
|
+
this.textInput = '';
|
104
|
+
|
93
|
-
}
|
105
|
+
}
|
94
106
|
|
95
107
|
}
|
96
108
|
|
97
|
-
}
|
109
|
+
};
|
110
|
+
|
111
|
+
</script>
|
98
112
|
|
99
113
|
```
|
1
コードの編集」
test
CHANGED
File without changes
|
test
CHANGED
@@ -84,9 +84,13 @@
|
|
84
84
|
|
85
85
|
return {
|
86
86
|
|
87
|
+
textInputs: {
|
88
|
+
|
87
89
|
textInput: '',
|
88
90
|
|
89
91
|
}
|
92
|
+
|
93
|
+
}
|
90
94
|
|
91
95
|
}
|
92
96
|
|