feat(system): app update log
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
@left-click="goBack"
|
||||
/>
|
||||
<main class="tui-page-content scroll column">
|
||||
<div class="agreement-page">
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { type Article, ArticleAPI, AttachmentAPI } from "timi-web-api";
|
||||
import { ArticleView } from "timi-tdesign-mobile";
|
||||
import { ArticleView, usePane } from "timi-tdesign-mobile";
|
||||
import { MarkdownView } from "timi-web";
|
||||
import { getErrorMessage } from "@/utils/error";
|
||||
import { Message } from "@/utils/message";
|
||||
@@ -45,6 +45,17 @@ defineOptions({
|
||||
});
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const pane = usePane();
|
||||
const props = defineProps<{ articleId?: string }>();
|
||||
|
||||
function goBack(): void {
|
||||
if (pane) {
|
||||
pane.close();
|
||||
return;
|
||||
}
|
||||
router.back();
|
||||
}
|
||||
|
||||
const routeNavBarTitle = computed(() => {
|
||||
switch (route.name) {
|
||||
@@ -57,7 +68,7 @@ const routeNavBarTitle = computed(() => {
|
||||
case "OpenSourceAgreement":
|
||||
return "开源软件协议";
|
||||
default:
|
||||
return "";
|
||||
return "协议";
|
||||
}
|
||||
});
|
||||
const article = ref<Article>();
|
||||
@@ -72,7 +83,7 @@ async function loadArticle(): Promise<void> {
|
||||
const requestToken = loadToken + 1;
|
||||
loadToken = requestToken;
|
||||
article.value = undefined;
|
||||
const articleId = String(route.params.id || "").trim();
|
||||
const articleId = String(props.articleId || route.params.id || "").trim();
|
||||
if (!articleId) {
|
||||
return;
|
||||
}
|
||||
@@ -93,7 +104,7 @@ async function loadArticle(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
watch(() => route.params.id, async () => {
|
||||
watch(() => props.articleId || route.params.id, async () => {
|
||||
await loadArticle();
|
||||
}, { immediate: true });
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user