fix: 修复路径收藏加载错误的问题
This commit is contained in:
@@ -80,9 +80,16 @@ onMounted(() => {
|
||||
|
||||
// +++ 加载 Header 可见性状态 +++
|
||||
layoutStore.loadHeaderVisibility();
|
||||
favoritePathsStore.initializeFavoritePaths(t); // +++ 初始化收藏路径数据 +++
|
||||
|
||||
});
|
||||
|
||||
// +++ 监听用户认证状态,登录后初始化收藏路径 +++
|
||||
watch(isAuthenticated, (loggedIn) => {
|
||||
if (loggedIn) {
|
||||
favoritePathsStore.initializeFavoritePaths(t);
|
||||
}
|
||||
}, { immediate: true });
|
||||
|
||||
// +++ 卸载钩子以移除监听器 +++
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('keydown', handleAltKeyDown); // +++ 移除 keydown 监听 +++
|
||||
|
||||
Reference in New Issue
Block a user