Commit 05a18e2f by 李宁

1

1 parent c362b73a
<template> <template>
<div id="app"> <div id="app">
<keep-alive>
<router-view/> <router-view/>
</keep-alive>
</div> </div>
</template> </template>
......
...@@ -272,12 +272,10 @@ export default { ...@@ -272,12 +272,10 @@ export default {
}) })
} }
}, },
activated(){
this.acc = JSON.parse(localStorage.getItem('accountInfo'))
},
created() { created() {
// 初始化认证状态 // 初始化认证状态
this.$store.dispatch('initializeAuth') this.$store.dispatch('initializeAuth')
this.acc = JSON.parse(localStorage.getItem('accountInfo'))
} }
} }
</script> </script>
......
...@@ -540,7 +540,6 @@ export default { ...@@ -540,7 +540,6 @@ export default {
this.queryStatus() this.queryStatus()
this.queryAllBusiLabel() this.queryAllBusiLabel()
}, },
mounted() { mounted() {
// 延迟注册滚动事件监听器,确保DOM已完全加载 // 延迟注册滚动事件监听器,确保DOM已完全加载
this.$nextTick(() => { this.$nextTick(() => {
...@@ -551,19 +550,6 @@ export default { ...@@ -551,19 +550,6 @@ export default {
}) })
}, },
// keep-alive 激活时的生命周期钩子
activated() {
// 重新注册滚动事件监听器
window.addEventListener('scroll', this.handleScroll, { passive: true })
console.log('组件被激活,重新注册滚动监听')
},
// 组件失活时移除监听器
deactivated() {
window.removeEventListener('scroll', this.handleScroll)
console.log('组件失活,移除滚动监听')
},
// 组件销毁时移除监听器 // 组件销毁时移除监听器
beforeDestroy() { beforeDestroy() {
if (this.scrollTimer) { if (this.scrollTimer) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!