feat: 优化路径收藏模态框加载逻辑

This commit is contained in:
Baobhan Sith
2025-05-24 22:41:13 +08:00
parent 5c73dc5a2d
commit b1adc0ebd4
3 changed files with 8 additions and 203 deletions
@@ -163,7 +163,6 @@ const handleClickOutside = (event: MouseEvent) => {
watch(() => props.isVisible, (newValue: boolean) => {
if (newValue) {
favoritePathsStore.fetchFavoritePaths(t);
searchTerm.value = '';
document.addEventListener('mousedown', handleClickOutside);
nextTick(() => { // Ensure DOM is ready for measurements
@@ -178,8 +177,12 @@ watch(() => props.isVisible, (newValue: boolean) => {
onMounted(() => {
if (props.isVisible) {
favoritePathsStore.fetchFavoritePaths(t);
searchTerm.value = '';
document.addEventListener('mousedown', handleClickOutside);
nextTick(() => {
updatePosition();
window.addEventListener('resize', updatePosition);
});
}
});