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?