Vben
authored
|
1
2
3
4
5
6
|
<template>
<PageWrapper title="关于">
<template #headerContent>
<div class="flex justify-between items-center">
<span class="flex-1">
<a :href="GITHUB_URL" target="_blank">{{ name }}</a>
|
Vben
authored
|
7
|
是一个基于Vue3.0、Vite、 Ant-Design-Vue 、TypeScript
|
Vben
authored
|
8
9
10
11
|
的后台解决方案,目标是为中大型项目开发,提供现成的开箱解决方案及丰富的示例,原则上不会限制任何代码用于商用。
</span>
</div>
</template>
|
Vben
authored
|
12
13
14
|
<Description @register="infoRegister" class="enter-y" />
<Description @register="register" class="my-4 enter-y" />
<Description @register="registerDev" class="enter-y" />
|
Vben
authored
|
15
16
|
</PageWrapper>
</template>
|
vben
authored
|
17
18
|
<script lang="ts" setup>
import { h } from 'vue';
|
Vben
authored
|
19
20
21
22
23
|
import { Tag } from 'ant-design-vue';
import { PageWrapper } from '/@/components/Page';
import { Description, DescItem, useDescription } from '/@/components/Description/index';
import { GITHUB_URL, SITE_URL, DOC_URL } from '/@/settings/siteSetting';
|
vben
authored
|
24
|
const { pkg, lastBuildTime } = __APP_INFO__;
|
Vben
authored
|
25
|
|
vben
authored
|
26
|
const { dependencies, devDependencies, name, version } = pkg;
|
Vben
authored
|
27
|
|
vben
authored
|
28
29
|
const schema: DescItem[] = [];
const devSchema: DescItem[] = [];
|
Vben
authored
|
30
|
|
vben
authored
|
31
32
|
const commonTagRender = (color: string) => (curVal) => h(Tag, { color }, () => curVal);
const commonLinkRender = (text: string) => (href) => h('a', { href, target: '_blank' }, text);
|
Vben
authored
|
33
|
|
vben
authored
|
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
const infoSchema: DescItem[] = [
{
label: '版本',
field: 'version',
render: commonTagRender('blue'),
},
{
label: '最后编译时间',
field: 'lastBuildTime',
render: commonTagRender('blue'),
},
{
label: '文档地址',
field: 'doc',
render: commonLinkRender('文档地址'),
},
{
label: '预览地址',
field: 'preview',
render: commonLinkRender('预览地址'),
},
{
label: 'Github',
field: 'github',
render: commonLinkRender('Github'),
},
];
|
Vben
authored
|
61
|
|
vben
authored
|
62
63
64
65
66
67
68
|
const infoData = {
version,
lastBuildTime,
doc: DOC_URL,
preview: SITE_URL,
github: GITHUB_URL,
};
|
Vben
authored
|
69
|
|
vben
authored
|
70
71
72
|
Object.keys(dependencies).forEach((key) => {
schema.push({ field: key, label: key });
});
|
Vben
authored
|
73
|
|
vben
authored
|
74
75
76
|
Object.keys(devDependencies).forEach((key) => {
devSchema.push({ field: key, label: key });
});
|
Vben
authored
|
77
|
|
vben
authored
|
78
79
80
81
82
83
|
const [register] = useDescription({
title: '生产环境依赖',
data: dependencies,
schema: schema,
column: 3,
});
|
Vben
authored
|
84
|
|
vben
authored
|
85
86
87
88
89
90
|
const [registerDev] = useDescription({
title: '开发环境依赖',
data: devDependencies,
schema: devSchema,
column: 3,
});
|
Vben
authored
|
91
|
|
vben
authored
|
92
93
94
95
96
|
const [infoRegister] = useDescription({
title: '项目信息',
data: infoData,
schema: infoSchema,
column: 2,
|
Vben
authored
|
97
98
|
});
</script>
|