Menu
CoddyTech

Recap: Seat Counter

Part of the Routing and State section of Coddy's Vue journey. Lesson 35 of 55.

challenge icon

Challenge

Medium

Build the seats options store with capacity 3 and reserved 0. Getter remaining is capacity minus reserved. Actions reserve and release must keep reserved between 0 and capacity inclusive. Extract reserved and remaining with storeToRefs for p#reserved and p#remaining. Both buttons must keep working after reaching either boundary.

Keep the supplied route readout and bootstrap files.

Try it yourself

<!doctype html><html><head><meta charset="UTF-8"><title>Routing practice</title></head><body><div id="app"></div><script type="module" src="./main.js"></script></body></html>

All lessons in Routing and State