This repository was archived by the owner on Jan 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,11 @@ html {
123123 display : none;
124124}
125125
126+ .task-complete {
127+ color : # aaa ;
128+ text-decoration : line-through;
129+ }
130+
126131.clear {
127132 clear : both;
128133}
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ <h3 class="category-name">{{ cat.name }}</h3>
3030 </ li >
3131 < li v-for ="(task, taskIndex) in cat.tasks " class ="task-list-item ">
3232 < div class ="delete-icon task-delete-icon " v-on:click ="showModal(taskIndex, 'task-delete', index) "> X</ div >
33- < p > {{ task }}</ p >
33+ < p v-bind:class =" {'task-complete': task.complete} " > {{ task.text }}</ p >
3434
3535 < div class ="clear "> </ div >
3636 </ li >
Original file line number Diff line number Diff line change @@ -78,9 +78,15 @@ var app = new Vue({
7878 input . value = "" ;
7979 } ,
8080 createTask : function ( category ) {
81- var task = document . getElementById ( category + '-task-input' ) . value . trim ( ) ;
82- // add task to category.tasks array & hide input
83- if ( task . length ) {
81+ var taskInput = document . getElementById ( category + '-task-input' ) . value . trim ( ) ;
82+
83+ if ( taskInput . length ) {
84+ // add task to category.tasks array & hide input
85+ var task = {
86+ 'text' : taskInput ,
87+ 'complete' : 0
88+ } ;
89+
8490 this . categories [ category ] . tasks . push ( task ) ;
8591 this . hideTaskInput ( this . lastNewTaskCategory ) ;
8692 }
You can’t perform that action at this time.
0 commit comments