Updating Community Tasks
Part of the Fundamentals section of Coddy's Vue journey. Lesson 53 of 55.
Keep everything from earlier steps, including adding tasks. Give every row button#toggle-ID and button#remove-ID. The child emits the task id with toggle or remove; the parent changes the matching record. Toggle must work in both directions; removal must leave other records intact. Update status labels and the summary from the source data. If no tasks remain, show p#empty with No tasks to show; otherwise that paragraph is absent.
Challenge
MediumKeep everything from earlier steps, including adding tasks. Give every row button#toggle-ID and button#remove-ID. The child emits the task id with toggle or remove; the parent changes the matching record. Toggle must work in both directions; removal must leave other records intact. Update status labels and the summary from the source data. If no tasks remain, show p#empty with No tasks to show; otherwise that paragraph is absent.
Try it yourself
<!doctype html><html><head><meta charset="UTF-8"><title>Vue practice</title></head><body><div id="app"></div><script type="module" src="./main.js"></script></body></html>This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Fundamentals
2Reactive State
Reactive RefsUpdating Refs in ScriptEvent Handler ArgumentsReactive ObjectsRecap: Reactive State5Conditions and Lists
Conditional BranchesShow without UnmountingRendering ListsStable List IdentityRecap: Conditions8Component Communication
Emitting EventsEvent PayloadsLifting Shared StateDefault and Named SlotsRecap: Shared Panel11Project: Community Board
Board StructureAdding Community Tasks