|
|
@ -3,7 +3,7 @@ |
|
|
|
<div class="mainContent" v-for="article in displayedData"> |
|
|
|
<div class="blogs" v-if="article.blogtitle"> |
|
|
|
<a-badge-ribbon :text=article.typename color="black"> |
|
|
|
<a-card hoverable> |
|
|
|
<a-card hoverable> |
|
|
|
<h2>{{ article.blogtitle }}</h2> |
|
|
|
<div class="tag-group"> |
|
|
|
<a-tag color="#E6E6FA"> |
|
|
@ -28,12 +28,12 @@ |
|
|
|
<template #icon> |
|
|
|
<component :is=iconComponents.YueDuLined /> |
|
|
|
</template> |
|
|
|
阅读时长≈{{ Math.round(article.blogcontent.length/ 200) }}分 |
|
|
|
阅读时长≈{{ Math.round(article.blogcontent.length / 200) }}分 |
|
|
|
</a-tag> |
|
|
|
</div> |
|
|
|
<div class="blog-content"> |
|
|
|
<div class="image-container"> |
|
|
|
<a-image :preview="false" :src=article.imglink class="responsive-image"/> |
|
|
|
<a-image :preview="false" :src=article.imglink class="responsive-image" /> |
|
|
|
</div> |
|
|
|
<div class="text-container"> |
|
|
|
{{ article.blogcontent }} |
|
|
@ -77,12 +77,12 @@ |
|
|
|
<template #icon> |
|
|
|
<component :is=iconComponents.YueDuLined /> |
|
|
|
</template> |
|
|
|
阅读时长≈{{ Math.round(article.diarycontent.length/ 200) }}分 |
|
|
|
阅读时长≈{{ Math.round(article.diarycontent.length / 200) }}分 |
|
|
|
</a-tag> |
|
|
|
</div> |
|
|
|
<div class="blog-content"> |
|
|
|
<div class="image-container"> |
|
|
|
<a-image :preview="false" :src=article.imglink class="responsive-image"/> |
|
|
|
<a-image :preview="false" :src=article.imglink class="responsive-image" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="read-button"> |
|
|
@ -112,7 +112,7 @@ |
|
|
|
import { onMounted, ref, watch } from 'vue'; |
|
|
|
import type { homePageInterface } from '@/api'; |
|
|
|
import iconComponents from "@/assets/index" |
|
|
|
import { get,put } from '@/tools/request'; |
|
|
|
import { get, put } from '@/tools/request'; |
|
|
|
import router from '@/router'; |
|
|
|
import { homePageStore } from '@/stores'; |
|
|
|
const homepageStore = homePageStore(); |
|
|
@ -120,10 +120,10 @@ const randomColor = () => { |
|
|
|
const labelColor = ref(["processing", "success", "error", "warning", "magenta", "red", "volcano", "orange", "gold", "lime", "green", "cyan", "blue", "geekblue", "purple"]) |
|
|
|
return labelColor.value[Math.floor(Math.random() * labelColor.value.length)]; |
|
|
|
} |
|
|
|
const blogCount=async (id:any)=>{ |
|
|
|
const blogCount = async (id: any) => { |
|
|
|
await put(`/blogs/update/${id}/readnum`) |
|
|
|
} |
|
|
|
const diaryCount=async (id:any)=>{ |
|
|
|
const diaryCount = async (id: any) => { |
|
|
|
await put(`/diarys/update/${id}/readnum`) |
|
|
|
} |
|
|
|
const readMoreBlog = (id: any) => { |
|
|
@ -204,21 +204,24 @@ watch(() => homepageStore.homepagelist, () => { |
|
|
|
|
|
|
|
.main .blog-content { |
|
|
|
display: flex; |
|
|
|
align-items: flex-start; |
|
|
|
margin: 48px; |
|
|
|
} |
|
|
|
|
|
|
|
.blogs .image-container { |
|
|
|
width: 300px; |
|
|
|
|
|
|
|
flex-shrink: 0; |
|
|
|
width: 200px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.blogs .responsive-image { |
|
|
|
width: 100%; |
|
|
|
height: auto; |
|
|
|
} |
|
|
|
|
|
|
|
.diarys .image-container { |
|
|
|
width: 1000px; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.diarys .responsive-image { |
|
|
@ -290,7 +293,7 @@ watch(() => homepageStore.homepagelist, () => { |
|
|
|
text-overflow: ellipsis; |
|
|
|
display: -webkit-box; |
|
|
|
-webkit-box-orient: vertical; |
|
|
|
-webkit-line-clamp: 6; |
|
|
|
-webkit-line-clamp: 4; |
|
|
|
word-wrap: break-word; |
|
|
|
overflow-wrap: break-word; |
|
|
|
line-height: 2; |
|
|
|