Skip to content

Commit 685169a

Browse files
committed
细节优化
1 parent 4a8874a commit 685169a

File tree

4 files changed

+42
-27
lines changed

4 files changed

+42
-27
lines changed

layouts/cpns/Footer.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
-->
88
<template>
99
<div class="flex-center border-t border-gray-300 p-4 pt-10 font-size-12px">
10-
<a href="https://github.com/yosong-github" target="_blank">
11-
<span class="mx-2">YOSONG</span>
10+
<a
11+
href="https://github.com/yosong-github"
12+
class="i-bxl-github w-25px h-25px"
13+
target="_blank"
14+
>
1215
</a>
13-
<i class="i-bxl-github w-20px h-20px" ref="themeRef" id="btn"></i>
1416
</div>
1517
</template>
1618

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"vue-router": "^4.3.2"
2626
},
2727
"devDependencies": {
28+
"@iconify-json/fa-brands": "^1.2.1",
2829
"@types/aos": "^3.0.7",
2930
"@types/ssh2": "^1.15.0",
3031
"@unocss/nuxt": "^0.59.4",

pages/[blogType]/index.vue

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
class="cursor-pointer font-size-26px font-weight-bold"
1515
:class="{
1616
'color-type': key !== activeIndex,
17-
}">
17+
}"
18+
>
1819
<span>{{ String(key).trim() }}</span>
1920
<span class="mr-6 font-size-16px">({{ _.length }})</span>
2021
</span>
@@ -24,10 +25,11 @@
2425
<template v-for="it in posts[activeIndex]">
2526
<NuxtLink
2627
:to="'/' + it._file!.slice(0, -3)"
27-
class="flex justify-between items-start my-2 py-2 cursor-pointer">
28+
class="flex justify-between items-start my-2 py-2 cursor-pointer light:hover:bg-light dark:hover:bg-dark p-4 rounded"
29+
>
2830
<span class="flex-1">{{ it.title }}</span>
2931
<span class="w-100px font-size-12px ml-5 color-#aaa">{{
30-
Dayjs(it.date).format('YYYY-MM-DD')
32+
Dayjs(it.date).format("YYYY-MM-DD")
3133
}}</span>
3234
</NuxtLink>
3335
</template>
@@ -36,41 +38,41 @@
3638
</template>
3739

3840
<script setup lang="ts">
39-
import { ref } from 'vue'
40-
import Dayjs from 'dayjs'
41-
import { getPosts } from '../../utils'
42-
import type { ParsedContent } from '@nuxt/content'
41+
import { ref } from "vue";
42+
import Dayjs from "dayjs";
43+
import { getPosts } from "../../utils";
44+
import type { ParsedContent } from "@nuxt/content";
4345
4446
// 当前激活的分类
45-
const activeIndex = ref<string | number>('')
47+
const activeIndex = ref<string | number>("");
4648
4749
// 所有文章
4850
const posts = ref<{
49-
[key: string]: ParsedContent[]
50-
}>({})
51+
[key: string]: ParsedContent[];
52+
}>({});
5153
5254
const typeCheck = (key: string | number) => {
53-
activeIndex.value = key
54-
sessionStorage.setItem('activeIndex', String(key))
55-
}
55+
activeIndex.value = key;
56+
sessionStorage.setItem("activeIndex", String(key));
57+
};
5658
5759
onMounted(() => {
5860
// 获取所有文章
59-
getPosts('/').then((res) => {
60-
posts.value = res
61-
if (sessionStorage.getItem('activeIndex') === null) {
62-
activeIndex.value = Object.keys(res)[0]
61+
getPosts("/").then((res) => {
62+
posts.value = res;
63+
if (sessionStorage.getItem("activeIndex") === null) {
64+
activeIndex.value = Object.keys(res)[0];
6365
} else {
64-
activeIndex.value = sessionStorage.getItem('activeIndex')!
66+
activeIndex.value = sessionStorage.getItem("activeIndex")!;
6567
}
66-
})
67-
})
68+
});
69+
});
6870
6971
useHead({
70-
title: 'yosong - blog',
72+
title: "yosong - blog",
7173
meta: [
72-
{ name: 'description', content: 'yosong blog list' },
73-
{ name: 'keywords', content: 'yosong blog' },
74+
{ name: "description", content: "yosong blog list" },
75+
{ name: "keywords", content: "yosong blog" },
7476
],
75-
})
77+
});
7678
</script>

pnpm-lock.yaml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)