I am new to Vue and NuxtJS and am currently working on creating a menu bar that spans across the top of the screen. However, I want it to disappear and be replaced by a "burger" button when the tab is small and the menu does not fit across the screen.
While I have been able to achieve this so far, my main issue now is that when I click the "burger" button, the menu items do not show up. How can I resolve this?
<template>
<div>
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex items-center justify-between h-16">
<div class="flex items-center">
<div class="hidden md:block">
<div class="ml-10 flex items-baseline">
<a
href="/product"
class="font-medium text-gray-500 hover:text-gray-900 transition duration-150 ease-in-out"
>Product
</a>
<a
href="/linkone"
class="ml-10 font-medium text-gray-500 hover:text-gray-900 transition duration-150 ease-in-out"
>Title One
</a>
<a
href="/linktwo"
class="ml-10 font-medium text-gray-500 hover:text-gray-900 transition duration-150 ease-in-out"
>Title Two
</a>
<a
href="/about"
class="ml-10 font-medium text-gray-500 hover:text-gray-900 transition duration-150 ease-in-out"
>About
</a>
</div>
</div>
</div>
<div class="-mr-2 flex md:hidden">
<!-- Mobile menu button -->
<button
type="button"
class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out"
id="main-menu"
aria-label="Main menu"
aria-haspopup="true"
>
<svg
class="block h-6 w-6"
stroke="currentColor"
fill="none"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M4 6h16M4 12h16M4 18h16"
/>
</svg>
<svg
class="hidden h-6 w-6"
stroke="currentColor"
fill="none"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M6 18L18 6M6 6l12 12"
/>
</svg>
</button>
</div>
</div>
</div>
<div class="hidden md:hidden">
<div class="px-2 pt-2 pb-3 sm:px-3">
<a
href="#"
class="block px-3 py-2 rounded-md text-base font-medium text-white bg-gray-900 focus:outline-none focus:text-white focus:bg-gray-700"
>Product</a
>
<a
href="#"
class="mt-1 block px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700"
>Title One</a
>
<a
href="#"
class="mt-1 block px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700"
>Title Two</a
>
<a
href="#"
class="mt-1 block px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700"
>About</a
>
</div>
</div>
</div>
</template>