Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

afterEach is always called #3918

Open
LLoyou00 opened this issue Feb 14, 2025 · 0 comments
Open

afterEach is always called #3918

LLoyou00 opened this issue Feb 14, 2025 · 0 comments

Comments

@LLoyou00
Copy link

<script setup lang="ts">
import { onBeforeRouteLeave, useRouter } from "vue-router";

const router = useRouter();

onBeforeRouteLeave(() => {
    return false;
});

// onBeforeRouteLeave((to, form, next) => {
//     next(false);
// });

router.beforeEach(() => {
    console.log("before");
});

router.afterEach(() => {
    console.log("after");
});
</script>

beforeEach will not be called,but afterEach is always called.
Is this as expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant