Exercise 3 | 20 mins

Step 1

<aside> 💡 Hint: You can simulate a REST API by moving the products.json file from the src/data directory to the public directory, then using fetch to make an async request like this: await fetch('/products.json').

</aside>

<aside> 💡 Hint: Don’t forget to parse the returned data using json()

</aside>

When this is done correctly you will get a very brief empty page under the header and then the products will display.

Screen Shot 2022-06-02 at 2.57.43 PM.png

Step 2

When this is done correctly you’ll be able to see the items you’ve added in the cart (though the red alert bubble will not yet be accurate).

pinia-cart-working.gif

Bonus

Add a loading indicator until the ProductsStore is filled.