From 1ffb1cef12df1bde4330a7c9531b6574a07d2fe6 Mon Sep 17 00:00:00 2001 From: Nikita Kiselev Date: Wed, 16 Jul 2025 07:46:13 +0300 Subject: [PATCH] fix: watch router --- spa/src/App.vue | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/spa/src/App.vue b/spa/src/App.vue index b1a2d15..9ffedc8 100644 --- a/spa/src/App.vue +++ b/spa/src/App.vue @@ -23,22 +23,15 @@ const route = useRoute(); const backButton = useBackButton(); watch( - () => route.fullPath, + () => route, () => { if (route.name === 'home') { - if (typeof backButton.hide === 'function') { - backButton.hide(); - } + backButton.hide?.(); } else { - if (typeof backButton.show === 'function') { - backButton.show(); - backButton.onClick(() => { - router.back(); - }); - } - + backButton.show?.(); + backButton.onClick?.(() => router.back()); } }, - { immediate: true } + { immediate: true, deep: true } );