NuxtN
Nuxt12mo ago
5 replies
Lynx

Cant assign `href` to `UButton` or `ULink`

Couldnt assign href attribute to UButton component, then i checked it out which is uses ULink underline. I tried on it as well but it doesnt render it as well (want to disable spa navigation to spesific pages)

          <u-button
            href="/login"
            icon="i-heroicons:arrow-left-on-rectangle-solid"
          >
            Login
          </u-button>

<!--  -->

          <u-link
            as="a"
            target="_self"
            :type="''"
            :href="{
              path: 'login',
            }"
            data-test="hoho"
          >
            Login
          </u-link>


Can't really understand whats wrong with the component: https://github.com/nuxt/ui/blob/dev/src/runtime/components/elements/Link.vue Does anyone have a clue? https://github.com/nuxt/ui/blob/dev/src/runtime/utils/link.ts everything looks ok with props though...
image.png
Was this page helpful?