This repository contains demo projects for learning Vue.js, organized by week.
Folder: VueWeek1
- Simple counter component implemented in vanilla JavaScript.
- Demonstrates basic component structure and reactivity.
- Files:
index.html: Main HTML file.js/app.js: Application logic.js/components/counterComponent.js: Counter component.
Folder: VueWeek2
- Todo list application with multiple components.
- Features:
- Add new todo items.
- Display a list of todos.
- Individual todo item component.
- Counter component reused from Week 1.
- Files:
index.html: Main HTML file.js/app.js: Application logic.js/components/addTodoFormComponent.js: Form to add todos.js/components/todoListComponent.js: List of todos.js/components/todoItemComponent.js: Individual todo item.js/components/counterComponent.js: Counter component.
Folder: VueWeek3
- Vue.js project scaffolded with Vite and Vue CLI.
- Demonstrates a more advanced project structure with single-file components and routing.
- Integrates with a mock REST API using
json-serveranddb/db.jsonfor course data. - Features:
- Home, About, and Counter components (
src/components/). - Vue Router for navigation (
src/router/). - Axios for HTTP requests to the mock API.
- Example course data in
db/db.json.
- Home, About, and Counter components (
- Files:
index.html: Main entry point for Vite.src/App.vue: Root Vue component.src/components/: ContainshomeComponent.vue,aboutComponent.vue,counterComponent.vue.src/router/: Vue Router setup.db/db.json: Mock database for course, lessons, and exercises.
- Install dependencies:
- Run
npm installin theVueWeek3folder.
- Start the development server:
- Run
npm run devin theVueWeek3folder.
- Start the mock API server:
- Run
json-server --watch db/db.json --port 3000in theVueWeek3folder.
- Open the app in your browser at the provided local URL (usually
http://localhost:5173). - The app will fetch course data from the mock API and display lessons and exercises.
These demos are intended for educational purposes and to illustrate core Vue.js concepts such as components, reactivity, event handling, routing, and API integration.