From 7b90befca3247140df27561e49e9acb10ae0d193 Mon Sep 17 00:00:00 2001 From: Muhibbudin Suretno Date: Thu, 21 Jun 2018 21:48:46 +0700 Subject: [PATCH 1/2] Update 2-playground-tutorial.md Hi there, I've followed this tutorial and I think on the function to add Todo does not validate user input for empty string. So i'm propose some minor change. Thank you --- content/docs/en/getting-started/2-playground-tutorial.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/docs/en/getting-started/2-playground-tutorial.md b/content/docs/en/getting-started/2-playground-tutorial.md index e2348d95..2e249da9 100644 --- a/content/docs/en/getting-started/2-playground-tutorial.md +++ b/content/docs/en/getting-started/2-playground-tutorial.md @@ -229,6 +229,7 @@ new Vue({ console.log('Task with index: ' + args.index + ' tapped'); // Logs tapped tasks in the console for debugging. }, onButtonTap() { + if (this.textFieldValue === "") return // Prevent user input empty string console.log("New task added: " + this.textFieldValue + "."); // Logs the newly added task in the console for debugging. this.todos.unshift({ name: this.textFieldValue }); // Adds tasks in the ToDo array. Newly added tasks are immediately shown on the screen. this.textFieldValue = ""; // Clears the text field so that users can start adding new tasks immediately. @@ -638,7 +639,7 @@ To implement a style particularly for the text of active tasks, you can set an ` 1. In `app.js`, on line 67, set an `id` for the `