index.vue
1.88 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
<template>
<div class="wrapper">
<div class="w-image">
<van-image v-if="avatar" class="van-hairline--surround" round width="3.8rem" height="3.8rem" lazy-load :src="avatar" style="position: absolute; left: 0.1rem; top: 0.1rem;" >
<template v-slot:error>加载失败</template>
</van-image>
<van-image v-else class="van-hairline--surround" round width="3.8rem" height="3.8rem" lazy-load :src="icon_avatar" style="position: absolute; left: 0.1rem; top: 0.1rem;" >
<template v-slot:error>加载失败</template>
</van-image>
</div>
<div class="text-wrapper" @click="handle">
<van-row align="center" justify="center" style="position: relative; top: 50%; transform: translateY(-50%);">
<van-col span="20" style="color: #713610;"><slot></slot></van-col>
<van-col span="4" style="text-align: center;"><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'
import { ref, reactive, onMounted } from 'vue'
const props = defineProps({
avatar: String
})
const emit = defineEmits(['on-click']);
const handle = () => {
emit('on-click', '')
}
onMounted(() => {
})
</script>
<script>
export default {
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</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;
}
.text-wrapper {
height: 100%;
text-align: left;
// line-height: 4rem;
padding-left: 3rem;
}
}
</style>