質問編集履歴
2
コードの修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -29,22 +29,29 @@
|
|
29
29
|
<template>
|
30
30
|
<div id="app">
|
31
31
|
<h1> ToDoアプリ</h1>
|
32
|
+
<form @submit.prevent="addItem">
|
32
33
|
<input type="text" v-model.lazy="textInput">
|
34
|
+
<input type="submit" value="追加">
|
35
|
+
</form>
|
33
|
-
|
36
|
+
<p v-for="textInput in textInputs" :key="textInput">
|
34
|
-
|
37
|
+
{{ textInput }}
|
35
|
-
|
38
|
+
</p>
|
36
39
|
</div>
|
37
40
|
</template>
|
38
41
|
|
39
42
|
<script>
|
40
|
-
|
41
43
|
export default {
|
42
44
|
data() {
|
43
45
|
return {
|
44
|
-
textInputs: {
|
45
46
|
textInput: '',
|
46
47
|
}
|
48
|
+
},
|
49
|
+
methods: {
|
50
|
+
addItem: function(){
|
51
|
+
this.textInputs.push(this.textInput);
|
52
|
+
this.textInput = '';
|
47
|
-
|
53
|
+
}
|
48
54
|
}
|
49
|
-
}
|
55
|
+
};
|
56
|
+
</script>
|
50
57
|
```
|
1
コードの編集」
title
CHANGED
File without changes
|
body
CHANGED
@@ -41,8 +41,10 @@
|
|
41
41
|
export default {
|
42
42
|
data() {
|
43
43
|
return {
|
44
|
+
textInputs: {
|
44
45
|
textInput: '',
|
45
46
|
}
|
47
|
+
}
|
46
48
|
}
|
47
49
|
}
|
48
50
|
```
|