How to use nuxt-link tag in Buefy?
Asked Answered
H

1

6

In Buefy navBar component item element have

<b-navbar-item href="/job">
            job
</b-navbar-item>

It render standart a html tag. When clicked, page reloaded. I want use nuxt-link Nuxt tag whithout reloading page.

This code works, but i got broken css design Bulma navbar.

<b-navbar-item >
    <nuxt-link to="/job">
        Job
    </nuxt-link>
</b-navbar-item>
Halfhour answered 5/8, 2019 at 12:19 Comment(0)
E
11

Two ways:

  1. Don't use buefy navbar, just class:
<nuxt-link to="/job" class="navbar-item">
    Job
</nuxt-link>
  1. Use tag:
<b-navbar-item tag="nuxt-link" to="/job">
    job
</b-navbar-item>

See https://buefy.org/documentation/navbar#api-view

Endometrium answered 21/8, 2019 at 10:30 Comment(2)
which one better? or whatever?Columbian
None is better than the other. It's a question of preference. If you need functionality of buefy navbar, go with it. This component is well written. If you don't need some many functionalities, you can go with your own implementation...Endometrium

© 2022 - 2024 — McMap. All rights reserved.