Ion-menu not working after back-button press

I’m New to ionic and try my first project.
When I click on a link and then ion-back-button the ion-menu 's does not work.
When I click on a link again it works.
The BaseLayout.vue file:

    <ion-router-outlet id="main"> </ion-router-outlet>
                <ion-buttons slot="start">
                    <ion-back-button color="danger"></ion-back-button>
                <ion-title>Test title
                   <div class="test1"> <router-link to="/r2/"> TEST 1</router-link></div>
                <ion-buttons slot="end">
            <slot />

in the router/index.js file

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
export default router