This is a solution to the REST Countries API with color theme switcher challenge on Frontend Mentor.
Note: Delete this note and update the table of contents based on what sections you keep.
Users should be able to:
- See all countries from the API on the homepage
- Search for a country using an
input
field - Filter countries by region
- Click on a country to see more detailed information on a separate page
- Click through to the border countries on the detail page
- Toggle the color scheme between light and dark mode
- Semantic HTML5 markup
- Tailwind Css - Css framework
- Mobile-first workflow
- Vue.js - JS library
- Vue Router
- Vue Store
The major learnings in this project is Vue Router. I not only know how to use router to navigate a declarative location but I understand how to use router's instance methods which can programmatically link to nested the routes.
Also, I confronted a problem on navigating between views. I found the URL was changed, while the page was not loaded. Fortunately, I found the solution is to add a key
prop to router-view (see below for the example) to force load.
<router-view :key="$route.path"/>
-
Stackoverflow - This helped me to avoid redundant navigation on Vue Router. See the code in Component-
Header
. -
Common Vue problems - This helpmed me to solve the problem that vue router doesn't reload when navigating between Cards.
- Frontend Mentor - @greatmetis
- LinkedIn - Chao-Chen(Metis) Teng
Big thanks to Front End Mentor provides such a great platform for developers like me.