fix: watch router
This commit is contained in:
@@ -23,22 +23,15 @@ const route = useRoute();
|
|||||||
const backButton = useBackButton();
|
const backButton = useBackButton();
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => route.fullPath,
|
() => route,
|
||||||
() => {
|
() => {
|
||||||
if (route.name === 'home') {
|
if (route.name === 'home') {
|
||||||
if (typeof backButton.hide === 'function') {
|
backButton.hide?.();
|
||||||
backButton.hide();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (typeof backButton.show === 'function') {
|
backButton.show?.();
|
||||||
backButton.show();
|
backButton.onClick?.(() => router.back());
|
||||||
backButton.onClick(() => {
|
|
||||||
router.back();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true, deep: true }
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user