Commit 05a18e2f by 李宁

1

1 parent c362b73a
<template>
<div id="app">
<keep-alive>
<router-view/>
</keep-alive>
<router-view/>
</div>
</template>
......
......@@ -272,12 +272,10 @@ export default {
})
}
},
activated(){
this.acc = JSON.parse(localStorage.getItem('accountInfo'))
},
created() {
// 初始化认证状态
this.$store.dispatch('initializeAuth')
this.acc = JSON.parse(localStorage.getItem('accountInfo'))
}
}
</script>
......
......@@ -540,7 +540,6 @@ export default {
this.queryStatus()
this.queryAllBusiLabel()
},
mounted() {
// 延迟注册滚动事件监听器,确保DOM已完全加载
this.$nextTick(() => {
......@@ -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() {
if (this.scrollTimer) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!