@@ -4,7 +4,6 @@ import { useRoute, useData } from "vitepress";
4
4
import { Reading , Clock , View } from " @element-plus/icons-vue" ;
5
5
import { FileInfo } from " vitepress-plugin-doc-analysis" ;
6
6
import { useNamespace , useBuSunZi , type UseBuSunZi } from " ../../../hooks" ;
7
- import { useUnrefData } from " ../../../configProvider" ;
8
7
import ArticleBreadcrumb from " ../../ArticleBreadcrumb" ;
9
8
import ArticleInfo from " ../../ArticleInfo" ;
10
9
import Icon from " ../../Icon" ;
@@ -15,19 +14,18 @@ defineOptions({ name: "ArticleAnalyze" });
15
14
16
15
const ns = useNamespace (" articleAnalyze" );
17
16
18
- const { theme } = useUnrefData ();
19
- const { theme : themeRef, frontmatter } = useData ();
17
+ const { theme, frontmatter } = useData ();
20
18
21
19
// 文章基本信息
22
20
const post = computed <TkContentData >(() => ({
23
- author: { ... theme .author , ... unref (frontmatter ).author },
21
+ author: { ... unref ( theme ) .author , ... unref (frontmatter ).author },
24
22
date: unref (frontmatter ).date ,
25
23
frontmatter: unref (frontmatter ),
26
24
url: " " ,
27
25
}));
28
26
29
27
// 站点信息数据
30
- const docAnalysisInfo = computed (() => unref (themeRef ).docAnalysisInfo || {});
28
+ const docAnalysisInfo = computed (() => unref (theme ).docAnalysisInfo || {});
31
29
32
30
// 文章阅读量、阅读时长、字数
33
31
const pageViewInfo = computed (() => {
@@ -41,7 +39,11 @@ const pageViewInfo = computed(() => {
41
39
42
40
// 文章信息配置项
43
41
const articleConfig = computed <Article >(() => {
44
- const { showInfo = true , showIcon = true , teleport = {} } = { ... theme .article , ... unref (frontmatter ).article };
42
+ const {
43
+ showInfo = true ,
44
+ showIcon = true ,
45
+ teleport = {},
46
+ } = { ... unref (theme ).article , ... unref (frontmatter ).article };
45
47
return { showInfo , showIcon , teleport };
46
48
});
47
49
@@ -79,7 +81,7 @@ const docAnalysisConfig = computed<DocAnalysis>(() => {
79
81
wordCount = true ,
80
82
readingTime = true ,
81
83
statistics = {},
82
- }: DocAnalysis = { ... theme .docAnalysis , ... unref (frontmatter ).docAnalysis };
84
+ }: DocAnalysis = { ... unref ( theme ) .docAnalysis , ... unref (frontmatter ).docAnalysis };
83
85
84
86
return { wordCount , readingTime , statistics };
85
87
});
0 commit comments