Skip to content

Commit 4ad0491

Browse files
Finished base portrait component.
1 parent b8584fb commit 4ad0491

File tree

5 files changed

+71
-23
lines changed

5 files changed

+71
-23
lines changed
Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
import { Vue, Component } from 'vue-property-decorator';
2+
import { Item } from '@/components/base/portrait/Portrait';
3+
import IconType from '@/enums/iconType';
24

35
@Component({})
46
export default class Sponsor extends Vue {
5-
7+
private imageSrc = 'https://picsum.photos/700?image=996';
8+
private listItems: Item[] = [{
9+
iconStart: IconType.Phone,
10+
title: '12313',
11+
iconEnd: IconType.MessageText,
12+
divider: true
13+
},
14+
{
15+
iconStart: IconType.Phone,
16+
title: '12313',
17+
iconEnd: IconType.MessageText,
18+
divider: true
19+
},
20+
{
21+
iconStart: IconType.Email,
22+
title: '12313',
23+
divider: true
24+
},
25+
{
26+
iconStart: IconType.MapMarker,
27+
title: '12313',
28+
divider: false
29+
}
30+
];
631
}

src/components/activity/sponsor/Sponsor.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
2-
<base-portrait>
2+
<base-portrait :image-src="imageSrc"
3+
:list-items="listItems">
34
</base-portrait>
45
</template>
56

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
import { Vue, Component, Prop } from 'vue-property-decorator'
1+
import { Vue, Component, Prop } from 'vue-property-decorator';
2+
import IconType from '@/enums/iconType';
3+
4+
export interface Item {
5+
iconStart ? : IconType;
6+
title: string;
7+
iconEnd ? : IconType;
8+
divider ? : boolean;
9+
}
210

311
@Component({})
412
export default class BasePortrait extends Vue {
13+
@Prop({ required: true }) imageSrc!: string;
14+
@Prop({ required: true }) listItems!: Item[];
515

616
}

src/components/base/portrait/Portrait.vue

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,31 @@
2121
</v-btn>
2222
</v-card-title> -->
2323

24-
<v-img src="https://picsum.photos/700?image=996"
24+
<v-img :src="imageSrc"
2525
height="200px"></v-img>
2626

2727
<v-list>
28-
<v-list-item>
29-
<v-list-item-action>
30-
<v-icon>mdi-phone</v-icon>
31-
</v-list-item-action>
32-
33-
<v-list-item-content>
34-
<v-list-item-title>(650) 555-1234</v-list-item-title>
35-
</v-list-item-content>
36-
<v-list-item-action>
37-
38-
<v-icon>mdi-message-text</v-icon>
39-
</v-list-item-action>
40-
</v-list-item>
41-
42-
<v-divider inset></v-divider>
43-
44-
<v-list-item>
28+
<template v-for="(item, i) in listItems">
29+
<v-list-item :key="'item' + i">
30+
<v-list-item-action v-if="item.iconStart">
31+
<v-icon>{{ item.iconStart }}</v-icon>
32+
</v-list-item-action>
33+
34+
<v-list-item-content>
35+
<v-list-item-title>{{ item.title }}</v-list-item-title>
36+
</v-list-item-content>
37+
38+
<v-list-item-action v-if="item.iconEnd">
39+
<v-icon>{{ item.iconEnd }}</v-icon>
40+
</v-list-item-action>
41+
</v-list-item>
42+
43+
<v-divider v-if="item.divider"
44+
:key="'divider'+ i"
45+
inset></v-divider>
46+
</template>
47+
48+
<!-- <v-list-item>
4549
<v-list-item-action>
4650
<v-icon>mdi-phone</v-icon>
4751
</v-list-item-action>
@@ -77,7 +81,7 @@
7781
<v-list-item-content>
7882
<v-list-item-title>Orlando, FL 79938</v-list-item-title>
7983
</v-list-item-content>
80-
</v-list-item>
84+
</v-list-item> -->
8185
</v-list>
8286

8387
</v-card>

src/enums/iconType.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22
// https://materialdesignicons.com/
33
enum IconType {
44
Person = 'person',
5-
Lock = 'lock'
5+
Lock = 'lock',
6+
Phone = 'mdi-phone',
7+
Pencil = 'mdi-pencil',
8+
Email = 'mdi-email',
9+
MessageText = 'mdi-message-text',
10+
ChevronLeft = 'mdi-chevron-left',
11+
DotsVertical = 'mdi-dots-vertical',
12+
MapMarker = 'mdi-map-marker'
13+
614
}
715

816
export default IconType;

0 commit comments

Comments
 (0)