Did the route jump after vue click?

implement a mobile menu, which is not displayed by default. The menu list is displayed only after clicking the menu key. It is found that the post-route does not jump according to the following code.

<template>
    <div id="header">
        <h1 class="name"></h1>
        <ul
            class="menu" 
            ref="menu" 
        >
            <router-link to="/" tag="li" class="menu-item"></router-link>
            <router-link to="/article" tag="li" class="menu-item"></router-link>
            <router-link to="/callMe" tag="li" class="menu-item"></router-link>
        </ul>
        <span 
            class="iconfont" 
            @click="handleIconClick"
            tabindex="0"
            @blur="handleItemBlur"
        ></span>
    </div>
</template>

<script>
export default {
    name: "Memu",
    methods: {
        handleIconClick() {
            let menuDis = this.$refs.menu.style.display;
            this.$refs.menu.style.display = menuDis === "none" ? "inline-block" : "none";
        },
        handleItemBlur() {
            this.$refs.menu.style.display = "none";
        }
    }
}
</script>

is it because you performed the hidden step after clicking, so you don"t jump?
how do I need to change it?

Jun.01,2021

router-link will be rendered as a tag, so it can jump. You used tag to turn it into li


Why don't you use v-show control when you are using vue,? Jump out of DOM
and is it possible for you to span tag binding event that loses focus? That's the problem

 
<template>
    <div id="header"  @click="handleItemBlur">
        <h1 class="name"></h1>
       <ul class="menu"   v-show="showMenu">
            <router-link to="/" tag="li" class="menu-item"></router-link>
            <router-link to="/article" tag="li" class="menu-item"></router-link>
            <router-link to="/callMe" tag="li" class="menu-item"></router-link>
        </ul>
        <span 
            class="iconfont" 
             @click.stop="handleIconClick"
            tabindex="0"
            
        ></span>
    </div>
</template>

<script>
export default {
    name: 'Memu',
       data (){
            return {
            showMenu:false,
            }
        },
    methods: {
        handleIconClick() {
            this.showMenu=!this.showMenu
          },
       handleItemBlur() {
            this.showMenu=false
          }
    }
}
</script>
 

how do you write your route?

for example:

{
          path: "callMe",
          name: "callMe",
          component: resolve =>
            require(["@/views/callMe.vue"], resolve)
        }

when in use:

<router-link :to="{name:'callMe'}"></router-link>
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e49502-666c4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e49502-666c4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?