Recap: Reactive State
Part of the Fundamentals section of Coddy's Vue journey. Lesson 10 of 55.
Challenge
EasyBuild a lending desk. Start with available = 8 and borrowed = 0 in one reactive object. Show Available: 8, borrowed: 0 in #result. Button #borrow transfers one to borrowed; #return transfers one back. Track total borrow actions in a separate ref shown in #visits, initially 0. Returning does not decrease that count.
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>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