add About page
This commit is contained in:
@ -10,11 +10,17 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { BEFlowerFall, Popup } from "timi-web";
|
import { BEFlowerFall, Popup } from "timi-web";
|
||||||
import { RootLayout, UserProfilePopup } from "timi-tdesign-pc";
|
import { RootLayout, UserProfilePopup } from "timi-tdesign-pc";
|
||||||
|
import { SettingMapper } from "../../timi-web";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const ready = ref(false);
|
const ready = ref(false);
|
||||||
onMounted(async () => ready.value = true);
|
onMounted(async () => {
|
||||||
|
await SettingMapper.loadSetting({
|
||||||
|
key: "GIT_ABOUT_ARTICLE"
|
||||||
|
});
|
||||||
|
ready.value = true;
|
||||||
|
});
|
||||||
|
|
||||||
// ---------- 文件详情页更宽的布局 ----------
|
// ---------- 文件详情页更宽的布局 ----------
|
||||||
const inFileDetail = ref(false);
|
const inFileDetail = ref(false);
|
||||||
|
|||||||
@ -21,6 +21,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<t-menu-item to="/" :value="Menu.LIST">仓库列表</t-menu-item>
|
<t-menu-item to="/" :value="Menu.LIST">仓库列表</t-menu-item>
|
||||||
<t-menu-item to="/log" :value="Menu.LOG">最近推送</t-menu-item>
|
<t-menu-item to="/log" :value="Menu.LOG">最近推送</t-menu-item>
|
||||||
|
<t-menu-item to="/about" :value="Menu.ABOUT">关于</t-menu-item>
|
||||||
<template #operations>
|
<template #operations>
|
||||||
<login-menu />
|
<login-menu />
|
||||||
</template>
|
</template>
|
||||||
@ -44,14 +45,16 @@ onMounted(async () => owner.value = await UserAPI.view(1));
|
|||||||
|
|
||||||
enum Menu {
|
enum Menu {
|
||||||
LIST = "LIST",
|
LIST = "LIST",
|
||||||
LOG = "LOG"
|
LOG = "LOG",
|
||||||
|
ABOUT = "ABOUT"
|
||||||
}
|
}
|
||||||
|
|
||||||
const regexMenu: {
|
const regexMenu: {
|
||||||
[key: string]: Menu
|
[key: string]: Menu
|
||||||
} = {
|
} = {
|
||||||
"RepositoryList": Menu.LIST,
|
"RepositoryList": Menu.LIST,
|
||||||
"RepositoryLog": Menu.LOG
|
"RepositoryLog": Menu.LOG,
|
||||||
|
"About": Menu.ABOUT
|
||||||
};
|
};
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
@ -76,7 +79,7 @@ onMounted(() => syncMenuRouter(route.name as string));
|
|||||||
|
|
||||||
.header {
|
.header {
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 1;
|
z-index: 3;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
background: rgba(231, 234, 239, .8);
|
background: rgba(231, 234, 239, .8);
|
||||||
border-bottom: var(--tui-border);
|
border-bottom: var(--tui-border);
|
||||||
|
|||||||
33
src/views/index/About.vue
Normal file
33
src/views/index/About.vue
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<template>
|
||||||
|
<article v-if="article" class="about">
|
||||||
|
<markdown-view class="content" :content="article.data" />
|
||||||
|
<comment
|
||||||
|
v-if="SettingMapper.is(SettingKey.ENABLE_COMMENT) && article.showComment"
|
||||||
|
:bizType="CommentBizType.ARTICLE"
|
||||||
|
:bizId="article.id!"
|
||||||
|
:titleStickyOffset="80"
|
||||||
|
:canComment="article.canComment"
|
||||||
|
/>
|
||||||
|
</article>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ArticleAPI, ArticleView, CommentBizType, MarkdownView, SettingKey, SettingMapper } from "timi-web";
|
||||||
|
import { Comment } from "timi-tdesign-pc";
|
||||||
|
|
||||||
|
const article = ref<ArticleView<any>>();
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
article.value = await ArticleAPI.view(SettingMapper.getValue("GIT_ABOUT_ARTICLE") as unknown as number);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.about {
|
||||||
|
|
||||||
|
.content {
|
||||||
|
width: calc(100% - 4rem);
|
||||||
|
padding: 1rem 2rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user