ZhangXianQiang
2024-06-03 5eebeba2a160192d48344ab587e90faaf6135dd8
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
<template>
  <div class="user-panel sticky left-10 top-5 max-w-sm">
    <el-card class="card">
      <div class="panel-content flex flex-col items-center">
        <div class="avatar-container w-40 h-40 rounded-full overflow-hidden">
          <div class="avatar-content">
            <img src="@/assets/image/avatar/avatar.png" class="avatar-img" alt="">
          </div>
          <!-- <div class="avatar-content" :style="{backgroundColor: getColor}">
            <div class="name text-5xl font-bold text-white">张</div>
          </div> -->
        </div>
 
        <div class="name-container text-lg font-bold mt-5 mb-2">
          测试测试
        </div>
 
        <div class="department-container text-base mb-10">
          测试测试
        </div>
 
        <div class="tool-container grid grid-cols-3 gap-10">
          <div class="tool-item text-center cursor-pointer" v-for="item in toolList">
            <div class="tool-icon mb-1">
              <img :src="item.iconPath" class="width-img" alt="">
            </div>
            <div class="tool-title">
              {{ item.title }}
            </div>
          </div>
        </div>
 
      </div>
    </el-card>
  </div>
</template>
 
<script setup>
import { ref, computed } from 'vue';
import randomColor from '@/utils/randomColor.js';
 
const toolList = ref([
  {
    id: 1,
    title: '资源共享',
    iconPath: new URL('@/assets/icons/icon1.png', import.meta.url).href
  },
  {
    id: 2,
    title: '我的课程',
    iconPath: new URL('@/assets/icons/icon2.png', import.meta.url).href
  },
  {
    id: 3,
    title: '我的课程',
    iconPath: new URL('@/assets/icons/icon2.png', import.meta.url).href
  },
  {
    id: 4,
    title: '我的课程',
    iconPath: new URL('@/assets/icons/icon2.png', import.meta.url).href
  },
]);
 
 
const getColor = computed(() => {
  return randomColor();
})
 
</script>
 
<style lang="scss" scoped>
 
 
.card {
  border-radius: 30px;
}
 
.avatar-content {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
 
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
</style>