From c3619066ea3d62361de95de3ff4c0da3fbc81f0e Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 30 Apr 2021 03:06:26 +0100 Subject: [PATCH] Reset input field --- examples/vue3-ts-todo-list/src/components/TodoList.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/vue3-ts-todo-list/src/components/TodoList.vue b/examples/vue3-ts-todo-list/src/components/TodoList.vue index 4e91f61d0c0..6e55841dc30 100644 --- a/examples/vue3-ts-todo-list/src/components/TodoList.vue +++ b/examples/vue3-ts-todo-list/src/components/TodoList.vue @@ -54,8 +54,12 @@ export default defineComponent({ return } try { + // Try and wrie the data to to the database const todo = await addTodo({ user_id: userSession.value.user.id, task: task.value }) - // If there was no response, dont do anything. + + // Reset inptut feild + task.value = '' + if (!todo) { return }