A
A
aloky2018-03-31 18:45:20
Vue.js
aloky, 2018-03-31 18:45:20

How to hide the router element in the home directory?

There is such a code, when the transition occurs in /add, you need to make it router-link to="/add"disappear. How to do it?

<router-link to="/">
      <img src="../assets/logo.png" alt="Logotype" class="logo mr-2">
      <a class="navbar-brand" href="#">
        Sale JS
      </a>
    </router-link>
    <router-link to="/add">
      <button class="btn btn-success link-add">
        <i class="fa fa-plus"></i>
      </button>
    </router-link>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2018-03-31
@aloky

<router-link to="/add" v-if="$route.path !== '/add'">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question