BeginnerCoder

Lesson 17 — Mini project: todo

A small todo app

Put the pieces together: v-model holds the text being typed, a ref holds the array of items, v-for shows them, and an add function puts the text into the array and clears the box. In Vue you can push into a reactive array — Vue notices the change.

function addTag() {
  tags.value.push(newTag.value)
  newTag.value = ""
}

Why it matters: this add-to-list flow is the core of comments, carts and playlists.

Want it another way?
Task

Finish add(). Typing Milk → Add, then Eggs → Add should list both items and leave the box empty.

← Back
Next →
Test your knowledge

A quick 3-question quiz on this lesson — instant feedback.

Enjoying this lesson? Share it.

Keep going with Vue.js Foundations

Ready for more? Optional paid resources that pick up where this lesson leaves off.

Some links on this page are affiliate links: we may earn a commission at no extra cost to you. As an Amazon Associate I earn from qualifying purchases.