feat: 更新UI
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<footer class="blog-site-footer">
|
||||
<span>© {{ new Date(startDay).getFullYear() }}-{{ new Date().getFullYear() }} Cxx</span>
|
||||
<span>本网站已安全运行 {{ getBlogRunTotalTime(startDay) }}</span>
|
||||
<span>博客全站共 {{ formatBlogWordCount(blogStore.blogStats.wordCount) }} 字</span>
|
||||
<span>本网站已安全运行{{ getBlogRunTotalTime(startDay) }}</span>
|
||||
<span>博客全站共{{ formatBlogWordCount(blogStore.blogStats.wordCount) }}字</span>
|
||||
</footer>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
overflow: auto;
|
||||
|
||||
.item {
|
||||
display: grid;
|
||||
grid-template-columns:30px 1fr;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
padding-bottom: 5px;
|
||||
|
||||
@@ -35,7 +35,10 @@
|
||||
background-color: blog.$card-bg-color;
|
||||
border: 1px solid blog.$border-color;
|
||||
border-radius: blog.$border-radius;
|
||||
box-shadow: 0 0 5px blog.$border-color;
|
||||
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.12),
|
||||
0 3px 1px -2px rgba(0,0,0,0.06),
|
||||
0 1px 5px 0 rgba(0,0,0,0.12),
|
||||
0 -1px 0.5px 0 rgba(0,0,0,0.09);
|
||||
|
||||
.module-title {
|
||||
background-color: blog.$theme-color;
|
||||
@@ -53,7 +56,10 @@
|
||||
background-color: blog.$card-bg-color;
|
||||
border: 1px solid blog.$border-color;
|
||||
border-radius: blog.$border-radius;
|
||||
box-shadow: 0 0 3px blog.$border-color;
|
||||
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.12),
|
||||
0 3px 1px -2px rgba(0,0,0,0.06),
|
||||
0 1px 5px 0 rgba(0,0,0,0.12),
|
||||
0 -1px 0.5px 0 rgba(0,0,0,0.09);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,8 @@ $sub-title-font-size: 1rem;
|
||||
}
|
||||
|
||||
.blog-menu-container {
|
||||
height: 95%;
|
||||
align-self: center;
|
||||
height: 90%;
|
||||
display: grid;
|
||||
grid-template-rows: repeat(4, 1fr);
|
||||
align-items: center;
|
||||
@@ -66,6 +67,10 @@ $sub-title-font-size: 1rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-menu {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
.blog-summary {
|
||||
|
||||
@@ -128,6 +128,10 @@ export const validateBlogImage = (files: File[]): boolean => {
|
||||
}
|
||||
|
||||
export const formatBlogWordCount = (count: number): string => {
|
||||
if (!count) {
|
||||
return ''
|
||||
}
|
||||
|
||||
if (count < 10000) return count.toString()
|
||||
|
||||
const units = ['万', '亿', '兆']
|
||||
@@ -138,8 +142,8 @@ export const formatBlogWordCount = (count: number): string => {
|
||||
unitIndex++
|
||||
}
|
||||
|
||||
// 保留一位小数
|
||||
const formattedNum = Math.round(count * 10) / 10
|
||||
// 保留两位小数,并移除末尾可能的零
|
||||
const formattedNum = count.toFixed(2).replace(/\.?0+$/, '')
|
||||
return `${formattedNum}${units[unitIndex]}`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user