Skip to content
This repository was archived by the owner on Nov 7, 2022. It is now read-only.

Commit 17f7001

Browse files
refactoring
maybe the headline component is overkill :D
1 parent fa4f5a5 commit 17f7001

File tree

4 files changed

+46
-24
lines changed

4 files changed

+46
-24
lines changed

components/LhCvList.vue

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
22
<section>
3-
<h2
3+
<lh-cv-list-headline
44
v-if="object.title"
55
v-text="object.title" />
66
<ul>
7-
<LhCvListItem
7+
<lh-cv-list-item
88
v-for="(item, index) in object.items"
99
:key="index"
1010
:item="item"
@@ -15,10 +15,12 @@
1515

1616
<script>
1717
import LhCvListItem from '~/components/LhCvListItem'
18+
import LhCvListHeadline from '~/components/LhCvListHeadline'
1819
export default {
1920
name: 'LhCvList',
2021
components: {
21-
LhCvListItem
22+
LhCvListItem,
23+
LhCvListHeadline
2224
},
2325
props: {
2426
object: {
@@ -40,21 +42,6 @@ section {
4042
&:last-of-type {
4143
margin: 0;
4244
}
43-
h2 {
44-
position: relative;
45-
color: $c-primary;
46-
text-align: left;
47-
margin: 0 0 $s-s 0;
48-
font-weight: 600;
49-
&:after {
50-
position: absolute;
51-
content: ' ';
52-
bottom: 0;
53-
left: 0;
54-
width: 3rem;
55-
border-bottom: 2px solid $c-accent;
56-
}
57-
}
5845
ul {
5946
padding: 0;
6047
margin: $s-xs 0 0 $s-xs;

components/LhCvListHeadline.vue

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<template>
2+
<h2
3+
v-text="title" />
4+
</template>
5+
6+
<script>
7+
export default {
8+
name: 'LhCvListHeadline',
9+
props: {
10+
title: {
11+
type: String,
12+
required: true
13+
},
14+
}
15+
}
16+
</script>
17+
18+
<style lang="scss" scoped>
19+
h2 {
20+
position: relative;
21+
color: $c-primary;
22+
text-align: left;
23+
margin: 0 0 $s-s 0;
24+
font-weight: 600;
25+
&:after {
26+
position: absolute;
27+
content: ' ';
28+
bottom: 0;
29+
left: 0;
30+
width: 3rem;
31+
border-bottom: 2px solid $c-accent;
32+
}
33+
}
34+
</style>

components/LhCvSkills.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<template>
2-
<section
3-
class="list">
2+
<section>
43
<h3
54
v-if="object.title"
65
v-text="object.title" />
@@ -26,7 +25,7 @@ export default {
2625
</script>
2726

2827
<style lang="scss" scoped>
29-
.list {
28+
section {
3029
margin: 0;
3130
h3 {
3231
font-weight: 600;

components/LhCvSkillsList.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
22
<aside>
3-
<h2
3+
<lh-cv-list-headline
44
v-if="object.title"
55
v-text="object.title" />
6-
<LhCvSkills
6+
<lh-cv-skills
77
class="skillsList"
88
v-for="(object, index) in object.items"
99
:key="index"
@@ -13,10 +13,12 @@
1313

1414
<script>
1515
import LhCvSkills from '~/components/LhCvSkills'
16+
import LhCvListHeadline from '~/components/LhCvListHeadline'
1617
export default {
1718
name: 'LhCvSkillsList',
1819
components: {
19-
LhCvSkills
20+
LhCvSkills,
21+
LhCvListHeadline
2022
},
2123
props: {
2224
object: {

0 commit comments

Comments
 (0)