parent
c36d23aaec
commit
b7bbfd8ac0
@ -1,3 +1,11 @@
|
||||
.el-menu--horizontal {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.card-box .el-card__body {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.el-card {
|
||||
border-radius: 10px;
|
||||
}
|
Before Width: | Height: | Size: 836 B After Width: | Height: | Size: 686 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@ -1,13 +1,75 @@
|
||||
<template>
|
||||
<el-card class="box-card" v-for="o in 10" :key="o" shadow="hover">
|
||||
<div>{{ 'Blog ' + o }}</div>
|
||||
<el-card class="card-box" v-for="item in blogList" :key="item" shadow="hover">
|
||||
<div class="blog-item">
|
||||
<el-row>
|
||||
<!-- 文章图片 -->
|
||||
<el-col :span="10">
|
||||
<img :src="item.firstPicture" alt="" class="first-picture" />
|
||||
</el-col>
|
||||
<!-- 文章标题和简述 -->
|
||||
<el-col :span="14">
|
||||
<div class="blog-container">
|
||||
<h3>{{ item.title }}</h3>
|
||||
<div class="description">{{ item.description }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script setup></script>
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
const blogList = ref([
|
||||
{
|
||||
firstPicture: 'https://w.wallhaven.cc/full/zy/wallhaven-zyxvqy.jpg',
|
||||
title: '测试',
|
||||
description: '这是一篇测试文章'
|
||||
},
|
||||
{
|
||||
firstPicture: 'https://w.wallhaven.cc/full/zy/wallhaven-zyxvqy.jpg',
|
||||
title: '测试',
|
||||
description: '这是一篇测试文章'
|
||||
},
|
||||
{
|
||||
firstPicture: 'https://w.wallhaven.cc/full/zy/wallhaven-zyxvqy.jpg',
|
||||
title: '测试',
|
||||
description: '这是一篇测试文章'
|
||||
},
|
||||
{
|
||||
firstPicture: 'https://w.wallhaven.cc/full/zy/wallhaven-zyxvqy.jpg',
|
||||
title: '测试',
|
||||
description: '这是一篇测试文章'
|
||||
},
|
||||
{
|
||||
firstPicture: 'https://w.wallhaven.cc/full/zy/wallhaven-zyxvqy.jpg',
|
||||
title: '测试',
|
||||
description: '这是一篇测试文章'
|
||||
}
|
||||
])
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.box-card {
|
||||
.card-box {
|
||||
margin: 20px 0;
|
||||
}
|
||||
.blog-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.first-picture {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-top-left-radius: 10px;
|
||||
border-bottom-left-radius: 10px;
|
||||
}
|
||||
.blog-container {
|
||||
padding: 20px 20px 20px 40px;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
.description {
|
||||
margin-top: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in new issue