File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
packages/vuexfire/examples/TodoApp Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 22
22
</ li >
23
23
</ ul >
24
24
< form @submit.prevent ="addTodo ">
25
- < input v-model ="newTodo " /> < button > Add #{{ items.length }}</ button >
25
+ < input v-model.trim ="newTodo " /> < button > Add #{{ items.length }}</ button >
26
26
</ form >
27
27
28
28
< br />
68
68
this . source . doc ( id ) . delete ( )
69
69
} ,
70
70
addTodo : function ( ) {
71
- if ( this . newTodo . trim ( ) ) {
71
+ if ( this . newTodo ) {
72
72
this . source . add ( {
73
73
text : this . newTodo ,
74
74
} )
Original file line number Diff line number Diff line change 60
60
itemsRef . doc ( id ) . delete ( )
61
61
} ,
62
62
addTodo : function ( ) {
63
- if ( this . newTodo . length < 1 ) return
64
- itemsRef . add ( {
65
- text : this . newTodo
66
- } )
67
- this . newTodo = ''
63
+ if ( this . newTodo ) {
64
+ itemsRef . add ( {
65
+ text : this . newTodo ,
66
+ } )
67
+ this . newTodo = ''
68
+ }
68
69
} ,
69
70
} ,
70
71
You can’t perform that action at this time.
0 commit comments