fix title for back
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user