BeginnerCoder

Lesson 22 — Mini project: todo (expert)

Add, tick, remove, count

A fuller todo list stores objects { text, done }. A checkbox with v-model="x.done" ticks an item directly. splice(i, 1) removes one item at index i from the array, and a computed counts what is left — all reactive, no manual re-drawing.

list.value.splice(2, 1) // remove the 3rd item

Why it matters: these four operations are the CRUD (create, read, update, delete) heart of most apps.

Want it another way?
Task

Write remove(i) and the remaining count. Add A, B, C, tick A, delete B → the list has 2 items and shows "1 left".

← 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.