Skip to content

Commit dbdb042

Browse files
committed
Add new home page with navigation and components
Introduce a new "home.html" entry point with a Vue app powered by `HomeApp.vue`. The app includes navigation between "About," "Blog," and "Contact" components. Updated `vite.config.js` to include the new "home" entry.
1 parent 26f06dd commit dbdb042

File tree

6 files changed

+73
-0
lines changed

6 files changed

+73
-0
lines changed

home.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + Vue</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/home.js"></script>
12+
</body>
13+
</html>

src/components/About.vue

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<script setup>
2+
3+
</script>
4+
5+
<template>
6+
<h1>About</h1>
7+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus at atque exercitationem itaque, porro
8+
repellendus tempora ut? A, dolorum fugit magnam molestiae nemo, perferendis perspiciatis praesentium quam veritatis,
9+
vero voluptatibus.</p>
10+
</template>
11+
12+
<style scoped>
13+
14+
</style>

src/components/Blog.vue

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<script setup>
2+
3+
</script>
4+
5+
<template>
6+
<h1>Blog</h1>
7+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam beatae excepturi molestias repudiandae totam!
8+
Aperiam assumenda at, doloremque, hic illo, mollitia natus necessitatibus nesciunt non nulla porro praesentium quod
9+
similique.</p>
10+
</template>
11+
12+
<style scoped>
13+
14+
</style>

src/components/HomeApp.vue

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<script setup>
2+
3+
import About from "./About.vue";
4+
import Blog from "./Blog.vue";
5+
import Contact from "./Contact.vue";
6+
import {ref} from "vue";
7+
8+
const currentPage = ref('about');
9+
10+
const pages = {
11+
about: About,
12+
blog: Blog,
13+
contact: Contact
14+
}
15+
</script>
16+
17+
<template>
18+
<button @click="currentPage = 'about'">About</button>
19+
<button @click="currentPage = 'blog'">Blog</button>
20+
<button @click="currentPage = 'contact'">Contact</button>
21+
22+
<component :is="pages[currentPage]"/>
23+
</template>
24+
25+
<style scoped>
26+
27+
</style>

src/home.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import {createApp} from "vue";
2+
import HomeApp from "./components/HomeApp.vue";
3+
4+
createApp(HomeApp).mount("#app");

vite.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default defineConfig({
1818
product: "product.html",
1919
note: "note.html",
2020
button: "button.html",
21+
home: "home.html",
2122
}
2223
}
2324
}

0 commit comments

Comments
 (0)