You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
house/fount/components/home/HomeComment.vue

102 lines
3.9 KiB

<template>
<div class="home-comment"> <!-- 定义用户留言组件的根容器 -->
<div class="title">用户留言</div> <!-- 显示标题用户留言 -->
<div class="comment-list"> <!-- 定义留言列表容器 -->
<div v-for="(item,index) in list" v-bind:key="index" class="comment-item"> <!-- 遍历留言列表,生成每个留言项 -->
<div class="user-content"> <!-- 用户信息容器 -->
<el-image
class="avator" <!-- 用户头像 -->
:src="item.avator" <!-- 绑定头像图片地址 -->
></el-image>
<span class="user">{{item.name}}</span> <!-- 显示用户名 -->
</div>
<div class="comment">{{item.content}}</div> <!-- 显示留言内容 -->
<div class="create-time">{{item.createTime}}</div> <!-- -->
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
list: [ // 定义留言数据列表
{
name: "MaskLin", // 用户名
avator:
"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", // 用户头像地址
content:
"你以为只要长得漂亮就有男生喜欢?你以为只要有了钱漂亮妹子就自己贴上来了?你以为学霸就能找到好工作?我告诉你吧,这些都是真的!", // 留言内容
createTime: "5月02日 00:00" // 留言时间
},
{
name: "MaskLin", // 用户名
avator:
"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", // 用户头像地址
content: "作者太帅了", // 留言内容
createTime: "5月04日 00:00" // 留言时间
},
{
name: "MaskLin", // 用户名
avator:
"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", // 用户头像地址
content: "作者太帅了", // 留言内容
createTime: "5月04日 00:00" // 留言时间
},
{
name: "MaskLin", // 用户名
avator: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", // 用户头像地址
content: "作者太帅了", // 留言内容
createTime: "5月04日 00:00" // 留言时间
}
]
};
}
};
</script>
<style lang="scss" scoped>
.home-comment {
background: #ffffff; /* 设置背景颜色为白色 */
.title {
font-size: 18px; /* 设置标题字体大小 */
color: #666; /* 设置标题字体颜色 */
font-weight: bold; /* 设置标题字体加粗 */
padding: 10px; /* 设置内边距 */
border-bottom: 1px solid #eeeeee; /* 设置底部边框 */
}
.comment-list {
padding: 10px; /* 设置内边距 */
.comment-item {
padding: 10px; /* 设置内边距 */
border-bottom: 1px solid #eeeeee; /* 设置底部边框 */
.user-content {
display: flex; /* 使用弹性布局 */
align-items: center; /* 子元素垂直居中对齐 */
.user {
font-size: 18px; /* 设置用户名字体大小 */
color: #666; /* 设置用户名字体颜色 */
font-weight: bold; /* 设置用户名字体加粗 */
line-height: 50px; /* 设置行高 */
margin-left: 10px; /* 设置左侧外边距 */
}
.avator {
width: 50px; /* 设置头像宽度 */
height: 50px; /* 设置头像高度 */
border-radius: 50%; /* 设置头像为圆形 */
}
}
.comment {
margin-top: 10px; /* 设置顶部外边距 */
font-size: 14px; /* 设置留言内容字体大小 */
color: #888888; /* 设置留言内容字体颜色 */
}
.create-time {
margin-top: 15px; /* 设置顶部外边距 */
font-size: 14px; /* 设置留言时间字体大小 */
color: #888888; /* 设置留言时间字体颜色 */
}
}
}
}
</style>