File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 36
36
type =" checkbox"
37
37
v-model =" todo.completed"
38
38
>
39
- <label class =" form-check-label" >
39
+ <label
40
+ class =" form-check-label"
41
+ :class =" { todo: todo.completed }"
42
+ >
40
43
{{ todo.subject }}
41
44
</label >
42
45
</div >
@@ -54,6 +57,10 @@ export default {
54
57
const todo = ref (' ' );
55
58
const todos = ref ([]);
56
59
const hasError = ref (false );
60
+ const todoStyle = {
61
+ textDecoration: ' line-through' ,
62
+ color: ' gray'
63
+ };
57
64
58
65
const onSubmit = () => {
59
66
if (todo .value === ' ' ) {
@@ -62,7 +69,7 @@ export default {
62
69
todos .value .push ({
63
70
id: Date .now (),
64
71
subject: todo .value ,
65
- completed: true ,
72
+ completed: false ,
66
73
});
67
74
hasError .value = false ;
68
75
todo .value = ' ' ;
@@ -74,13 +81,15 @@ export default {
74
81
todos,
75
82
onSubmit,
76
83
hasError,
84
+ todoStyle,
77
85
};
78
86
}
79
87
}
80
88
</script >
81
89
82
90
<style >
83
- .name {
84
- color : red ;
91
+ .todo {
92
+ color : gray ;
93
+ text-decoration : line-through ;
85
94
}
86
95
</style >
You can’t perform that action at this time.
0 commit comments