Institute of Computer Science
  1. Courses
  2. 2022/23 fall
  3. Web Application Development (LTAT.05.004)
ET
Log in

Web Application Development 2022/23 fall

  • Home
  • Lectures
  • Practicals
  • Homework Submission
  • Message Board

Session 8: Vue.Js - I

You have already created a "to-do list" relying on HTML, CSS, and JavaScript. Today, we will be creating a "to-do list" using Vue.Js.

Our "to-do list" (shown in the figure below) is composed of a form that contains:

  1. An "input text box" that can be used to enter a description of a task we want to add to our list.
  2. An "Add Task" button that "when pressed" will take the text written in the "input text box" and make it appears as a new task in our list after the last task. Note1: Pressing the "Add Task" button should empty the "input text box". Note2: The "Add Task" button should be disabled (you cannot press it), if the "input text box" is empty, i.e., you did not write anything in the "input text box".
  3. A "Delete all" button that "when pressed" all listed tasks should be deleted. Note1: The “Delete all” button should not be “shown” (rendered to the page) unless there is more than one task.

Each task in the “to-do list”:

  1. Should appear on a separate line,
  2. Should be accompanied by a “delete” button that when pressed, the task should be deleted.
  3. Should change its text decoration style to line-through and its text color to blue, when pressed on.

Based on your knowledge of HTML, CSS, JavaScript, and Vue.Js, how can we implement the previously described "to-do" list?

Take a moment to think about the following:

  • Where do we "put/save" our tasks, the tasks we are adding?
  • How many methods do we need?
  • How can we implement each of these methods?
  • How we can capture the text/value of the input text box and how we can add it to our list of tasks?
  • How can we empty the content of the “input text box” when we press the "Add Task" button?
  • How can we output (render) the tasks list to the page?
  • How can we make the "Delete all" button appear/disappear depending on the number of added tasks?
  • How can we change the text decoration style and color of the tasks, when we press on them?

An annotated solution exists in the following repository: Repo.

  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment