Prevent create empty item
This commit is contained in:
parent
7bc9904223
commit
95ca2ce47d
1 changed files with 1 additions and 1 deletions
|
|
@ -62,7 +62,7 @@ var state = {
|
||||||
//view
|
//view
|
||||||
var Todos = {
|
var Todos = {
|
||||||
add: function(e) {
|
add: function(e) {
|
||||||
if (e.keyCode === 13) {
|
if (e.keyCode === 13 && e.target.value) {
|
||||||
state.dispatch("createTodo", [e.target.value])
|
state.dispatch("createTodo", [e.target.value])
|
||||||
e.target.value = ""
|
e.target.value = ""
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue