🌐 EN
GM
Modern JS & Vue 3
Submissions
All (8)
Ungraded (5)
Late (3)
Returned (3)
Pinia store exercise
Assignment · Lesson 9 · Due 14 Jun
Submitted file
pinia-store-nino-beridze.zip
· 48 KB
Student's notes
I implemented a product cart store using Pinia with three getters (cartTotal, itemCount, hasItems) and two actions (addItem, removeItem). I used storeToRefs in the CartSidebar component to keep the reactive bindings without destructuring issues. One thing I wasn't sure about — should cartItems be a ref or a reactive array inside defineStore? I went with ref() based on the docs example. Please let me know if this is the preferred pattern.
Grade this submission
Score
/
100
Quick grade