fix: watch router

This commit is contained in:
Nikita Kiselev
2025-07-16 07:46:13 +03:00
parent 47bb2cae85
commit 1ffb1cef12

View File

@@ -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 }
);
</script>