Giter VIP home page Giter VIP logo

Comments (3)

iprzybysz avatar iprzybysz commented on May 24, 2024

Hi @hutong9, please provide a snippet of your code, then I'll try to help you.

from tw-elements.

hutong9 avatar hutong9 commented on May 24, 2024

`

<div style="position: relative;width:100%;"
  class="sm:container sm:mx-auto flex flex-wrap items-center justify-between  px-4">

  <!-- Logo -->
  <div>
    <a class="mx-2 my-1 flex items-center text-neutral-900 hover:text-neutral-900 focus:text-neutral-900 lg:mb-0 lg:mt-0"
      href="/">
      <img src="/images/logo.png" style="height: 30px left: 10px;" alt="CCF" loading="lazy" />
    </a>
  </div>
  <!-- Hamburger button for mobile view -->
  <button
    class="block border-0 bg-transparent px-2 text-neutral-200 hover:no-underline hover:shadow-none focus:no-underline focus:shadow-none focus:outline-none focus:ring-0 dark:text-neutral-200 lg:hidden"
    type="button" data-te-collapse-init data-te-target="#navbarSupportedContent8"
    aria-controls="navbarSupportedContent8" aria-expanded="false" aria-label="Toggle navigation"
    style="position:absolute;top:10px; right:15px;">
    <!-- Hamburger icon -->
    <span class="[&>svg]:w-7 ">
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="h-7 w-7 ">
        <path fill-rule="evenodd"
          d="M3 6.75A.75.75 0 013.75 6h16.5a.75.75 0 010 1.5H3.75A.75.75 0 013 6.75zM3 12a.75.75 0 01.75-.75h16.5a.75.75 0 010 1.5H3.75A.75.75 0 013 12zm0 5.25a.75.75 0 01.75-.75h16.5a.75.75 0 010 1.5H3.75a.75.75 0 01-.75-.75z"
          clip-rule="evenodd" />
      </svg>
    </span>
  </button>

  <!-- Collapsible navbar container -->
  <div
    class="!visible mt-2 hidden flex-grow basis-[100%] items-center justify-center lg:mt-0 lg:!flex lg:basis-auto "
    id="navbarSupportedContent8" data-te-collapse-item>
    <!-- Left links -->
    <ul class="list-style-none flex flex-col pl-0 lg:mt-1 lg:flex-row " data-te-navbar-nav-ref>
      <!-- Home link -->
      <li class="my-4  pl-2 lg:my-0 lg:pl-2 lg:pr-4" data-te-nav-item-ref>
        <NuxtLink to="/"
          class="p-0 text-neutral-200 transition duration-200 hover:text-blue-300 hover:ease-in-out focus:text-yellow-500 disabled:text-black/30 motion-reduce:transition-none dark:text-neutral-200 dark:hover:text-neutral-400 dark:focus:text-neutral-400 lg:px-2 [&.active]:text-black/90 dark:[&.active]:text-neutral-400">
          首页</NuxtLink>
      </li>
      <li class="my-4  pl-2 lg:my-0 lg:pl-2 lg:pr-4" data-te-nav-item-ref>
        <NuxtLink to="/introduction"
          class="p-0 text-neutral-200 transition duration-200 hover:text-blue-300 hover:ease-in-out focus:text-yellow-500 disabled:text-black/30 motion-reduce:transition-none dark:text-neutral-200 dark:hover:text-neutral-400 dark:focus:text-neutral-400 lg:px-2 [&.active]:text-black/90 dark:[&.active]:text-neutral-400">
          大会介绍</NuxtLink>
      </li>

      <!-- Link -->
      <li class="mb-4 pl-2 lg:mb-0 lg:pl-0 lg:pr-4" data-te-nav-item-ref>
        <NuxtLink to="#"
          class="p-0 text-neutral-200 transition duration-200 hover:text-blue-300 hover:ease-in-out focus:text-yellow-500 disabled:text-black/30 motion-reduce:transition-none dark:text-neutral-200 dark:hover:text-neutral-400 dark:focus:text-neutral-400 lg:px-2 [&.active]:text-black/90 dark:[&.active]:text-neutral-400">
          征稿通知</NuxtLink>
      </li>
    </ul>
  </div>
</div>
<script setup> import { onMounted } from "vue"; const route = useRoute() onMounted(async () => { const { Dropdown, initTE, Ripple, Collapse } = await import("tw-elements"); initTE({ Dropdown, Ripple, Collapse }); }); </script> <style scoped> nav[data-te-navbar-ref] { background-color: rgb(10, 10, 128); color: white; } ul[data-te-navbar-nav-ref] li[data-te-nav-item-ref]:active { color: red; } ul[data-te-dropdown-menu-ref] { background-color: rgb(10, 10, 128); padding: 10px; } ul[data-te-dropdown-menu-ref] li { line-height: 2; } </style>`

from tw-elements.

iprzybysz avatar iprzybysz commented on May 24, 2024

You don't have a nav wrapper element in your code and data-te-nav-link-ref on NuxtLink elements. I recommend you check out our Basic example in the Navbar documentation and compare correctness with yours. It should help you with debugging any issues.

from tw-elements.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.