Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
mlaj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-10-22 12:55:48 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8f0be273a8969b22bc2520a76c09dd78e2699ac0
8f0be273
1 parent
81f5ccc0
fix(PdfPreviewPage): 在组件卸载前清除刷新标记
添加onBeforeUnmount钩子清除sessionStorage中的刷新标记,防止状态残留
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletions
src/views/study/PdfPreviewPage.vue
src/views/study/PdfPreviewPage.vue
View file @
8f0be27
...
...
@@ -12,7 +12,7 @@
</template>
<script setup>
import { computed, onMounted } from 'vue'
import { computed, onMounted
, onBeforeUnmount
} from 'vue'
import { useRoute, useRouter } from 'vue-router'
import PdfViewer from '@/components/ui/PdfViewer.vue'
...
...
@@ -60,6 +60,14 @@ onMounted(() => {
window.location.reload()
}
})
/**
* 组件卸载前清除刷新标记
*/
onBeforeUnmount(() => {
// 清除刷新标记,确保离开页面时清理状态
sessionStorage.removeItem('pdf-preview-refreshed')
})
</script>
<style scoped>
...
...
Please
register
or
login
to post a comment