zan-bar.vue
597 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<template>
<div class="flex">
<WidgetAvatarGroup :avatars="praiseHeadIco"></WidgetAvatarGroup>
<span class="v-center">{{praiseCount}}人喜欢</span>
<span class="time v-center text-right">{{publish_time | formatTime}}</span>
</div>
</template>
<script>
export default {
name: 'ZanBar',
props: ['praiseHeadIco', 'praiseCount', 'publish_time'],
filters: {
formatTime(str) {
return '1天前';
}
}
};
</script>
<style scoped>
.flex {
display: flex;
}
.v-center {
align-self: center;
}
.time {
flex: 1;
}
.text-right {
text-align: right;
}
</style>