fix title for back
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { onBeforeRouteLeave } from "vue-router";
|
||||||
import { type Article, ArticleAPI, AttachmentAPI } from "timi-web-api";
|
import { type Article, ArticleAPI, AttachmentAPI } from "timi-web-api";
|
||||||
import { ArticleView } from "timi-tdesign-mobile";
|
import { ArticleView } from "timi-tdesign-mobile";
|
||||||
import { useNavBarStore } from "@/store/navBarStore";
|
import { useNavBarStore } from "@/store/navBarStore";
|
||||||
@@ -70,6 +71,11 @@ async function loadArticle(): Promise<void> {
|
|||||||
watch(() => route.params.id, async () => {
|
watch(() => route.params.id, async () => {
|
||||||
await loadArticle();
|
await loadArticle();
|
||||||
}, { immediate: true });
|
}, { immediate: true });
|
||||||
|
|
||||||
|
onBeforeRouteLeave(() => {
|
||||||
|
loadToken += 1;
|
||||||
|
navBarStore.setTitle(getRouteNavBarTitle());
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
|
|||||||
Reference in New Issue
Block a user