fix title for back

This commit is contained in:
Timi
2026-09-15 11:47:06 +08:00
parent 169c36734a
commit 5da177dbf8
+6
View File
@@ -16,6 +16,7 @@
</template>
<script setup lang="ts">
import { onBeforeRouteLeave } from "vue-router";
import { type Article, ArticleAPI, AttachmentAPI } from "timi-web-api";
import { ArticleView } from "timi-tdesign-mobile";
import { useNavBarStore } from "@/store/navBarStore";
@@ -70,6 +71,11 @@ async function loadArticle(): Promise<void> {
watch(() => route.params.id, async () => {
await loadArticle();
}, { immediate: true });
onBeforeRouteLeave(() => {
loadToken += 1;
navBarStore.setTitle(getRouteNavBarTitle());
});
</script>
<style scoped lang="less">