forked from ChanWahFung/nuxt-juejin-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuserItem.vue
More file actions
96 lines (87 loc) · 2.11 KB
/
userItem.vue
File metadata and controls
96 lines (87 loc) · 2.11 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<template>
<nuxt-link :to="'/user/'+item.id" target="_blank">
<div class="user-item">
<div class="user-item__avatar">
<user-avatar :url="item.avatarLarge" :round="true"></user-avatar>
</div>
<div class="user-item__info">
<p class="user-item__userinfo">
<span class="user-item__username" v-html="highlight.username || item.username"></span>
<span v-if="item.level > 0" style="margin-right: 10px">
<level :level="item.level"></level>
</span>
<span v-if="highlight.jobTitle" v-html="highlight.jobTitle"></span>
<span v-else>
{{ item.jobTitle }}
{{ item.jobTitle&&item.company ? ' @ ' : '' }}
{{ item.company }}
</span>
</p>
<p>{{ item.postedPostsCount }}专栏 · {{ item.followersCount }}个关注者</p>
</div>
<div class="user-item__btn">
<follow-btn :is-follow.sync="item.viewerIsFollowing" type="user" :followee-id="item.id"></follow-btn>
</div>
</div>
</nuxt-link>
</template>
<script>
export default {
props: {
item: {
type: Object,
default: () => ({})
},
highlight: {
type: Object,
default: () => ({})
}
}
}
</script>
<style lang='scss' scoped>
.user-item {
display: flex;
padding: 20px 25px;
cursor: pointer;
&:hover{
background: rgba(0,0,0,.01);
}
.user-item__avatar {
position: relative;
width: 42px;
height: 42px;
margin-right: 15px;
border-radius: 50%;
overflow: hidden;
object-fit: contain;
}
.user-item__info{
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 2px 0;
font-size: 13px;
color: #8a9aa9;
.user-item__userinfo {
display: flex;
align-items: center;
font-size: 14px;
color: #909090;
.user-item__username {
margin-right: 5px;
font-size: 16px;
font-weight: bold;
color: #2e3135;
}
/deep/ em {
color: #e8001c;
}
}
}
.user-item__btn{
margin-left: auto;
align-self: center;
}
}
</style>