Recap: Forms
Part of the Fundamentals section of Coddy's Vue journey. Lesson 20 of 55.
Challenge
EasyBuild a shift signup form. The name starts empty, hours starts at 1, and confirmation starts false. Bind #name to a trimmed string, #hours to a numeric model, and checkbox #confirmed to the boolean. In #result, display the name in brackets, followed by hours plus one and confirmation, formatted [Name] | 3 hours with setup | true using actual values. Button #reset restores all three initial values. Tests enter valid numeric hours.
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