index.vue
1.6 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
<template>
<div class="wrapper">
<div class="w-image">
<van-image class="van-hairline--surround avatar" round :src="avatar ? avatar : icon_avatar">
<template #error>加载失败</template>
</van-image>
</div>
<div class="text-wrapper">
<van-row align="center" justify="center" class="center-content">
<van-col span="20" style="color: #713610;">
<slot />
</van-col>
<van-col span="4" style="text-align: center;" @click="handle">
<van-icon name="arrow" color="#c5c5c5" size="1.25rem" />
</van-col>
</van-row>
</div>
</div>
</template>
<script setup>
import icon_avatar from '@images/que-logo@2x.png'
// eslint-disable-next-line no-unused-vars
const props = defineProps({
avatar: {
type: String,
default: ''
}
})
const emit = defineEmits(['on-icon-click']);
const handle = () => {
emit('on-icon-click', '')
}
</script>
<style lang="less" scoped>
.wrapper {
position: relative;
background-color: #fff;
margin: 2rem;
margin-right: 0;
margin-left: 4rem;
height: 4rem;
box-shadow: 0px 0px 4px 0px rgba(73, 156, 255, 0.2);
.w-image {
width: 4rem;
height: 4rem;
border-radius: 50%;
background-color: #FFF;
position: absolute;
left: -2rem;
.avatar {
position: absolute;
left: 0.1rem;
top: 0.1rem;
width: 3.8rem;
height: 3.8rem;
}
}
.text-wrapper {
height: 100%;
text-align: left;
// line-height: 4rem;
padding-left: 3rem;
.center-content{
position: relative; top: 50%; transform: translateY(-50%);
}
}
}
</style>