Skip to content

Commit 845e1da

Browse files
author
zh.sundetov
committed
decomposition navbar
1 parent 533012a commit 845e1da

File tree

5 files changed

+38
-69
lines changed

5 files changed

+38
-69
lines changed

src/App.vue

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<template>
2-
<nav>
3-
<router-link style="margin-right: 5px;" to="/">Home</router-link>
4-
<router-link to="/about">Post blog</router-link>
5-
</nav>
2+
<div class="app">
3+
<navbar/>
4+
</div>
65
<router-view/>
76

87
</template>
98
<script>
109
import PostList from "@/views/components/post-blog-components/PostList";
1110
import PostForm from "@/views/components/post-blog-components/PostForm";
11+
import Navbar from "@/views/components/navbar/Navbar"
1212
1313
export default {
1414
components: {
15-
PostForm, PostList
15+
PostForm, PostList, Navbar
1616
},
1717
data: function () {
1818
return {
@@ -35,8 +35,10 @@ export default {
3535
}
3636
</script>
3737
<style scoped>
38-
#app {
39-
font-family: Avenir, Helvetica, Arial, sans-serif;
38+
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap');
39+
40+
.app {
41+
font-family: 'Roboto', sans-serif;
4042
-webkit-font-smoothing: antialiased;
4143
-moz-osx-font-smoothing: grayscale;
4244
text-align: center;

src/components/HelloWorld.vue

-59
This file was deleted.

src/views/PostBlogView.vue

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div>
2+
<div class="post-blog">
33
<post-form @create="createPost($event)" />
44
<post-list :posts="posts"/>
55
</div>
@@ -31,4 +31,9 @@ export default {
3131
}
3232
3333
}
34-
</script>
34+
</script>
35+
<style scoped>
36+
.post-blog {
37+
font-family: 'Roboto', sans-serif;
38+
}
39+
</style>
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<template>
2+
<div class="navbar" style="">
3+
<div>
4+
<router-link to="/">Home</router-link>
5+
</div>
6+
<div>
7+
<router-link to="/about">Post blog</router-link>
8+
</div>
9+
</div>
10+
</template>
11+
<style scoped>
12+
a {
13+
text-decoration: none; /* Отменяем подчеркивание у ссылки */
14+
}
15+
16+
.navbar {
17+
display: flex;
18+
gap: 30px;
19+
font-weight: bold;
20+
}
21+
</style>

src/views/components/post-blog-components/PostItem.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default {
3636
.post-title {
3737
font-size: 24px;
3838
font-weight: bold;
39-
text-align: center;
39+
padding-left: 15px;
4040
}
4141
4242
.post-body {

0 commit comments

Comments
 (0)