Refactor code structure and remove redundant changes
This commit is contained in:
50
pages/community/components/TeacherCard.vue
Normal file
50
pages/community/components/TeacherCard.vue
Normal file
@ -0,0 +1,50 @@
|
||||
<template>
|
||||
<div class="teacher-card">
|
||||
<div class="avatar">
|
||||
<!-- 这里可以放置教师头像 -->
|
||||
</div>
|
||||
<h3>{{ teacher.name }}</h3>
|
||||
<p class="title">{{ teacher.title }}</p>
|
||||
<div class="tags">
|
||||
<span v-for="tag in teacher.tags" :key="tag" class="tag">
|
||||
{{ tag }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
defineProps({
|
||||
teacher: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.teacher-card {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
padding: 15px;
|
||||
text-align: center;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background: #eee;
|
||||
border-radius: 50%;
|
||||
margin: 0 auto 10px;
|
||||
}
|
||||
|
||||
.tag {
|
||||
background: #e8f3ff;
|
||||
color: #4080ff;
|
||||
padding: 2px 8px;
|
||||
border-radius: 12px;
|
||||
font-size: 12px;
|
||||
margin: 0 4px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user