title: How to show button checking a localStorage key?
body: <p>When I log out I delete the token. Here is how I check if the token is deleted:</p>
  <pre><code>  const isLoggedOut = () =&gt; {
      let token = window.localStorage.getItem('token')
      if (token === undefined || token === null || token.length === 0) {
        console.log(&quot;user is logged out&quot;)
        return true
      }
      else {
        console.log(&quot;user is logged in&quot;)
        return false
      }
    }
  </code></pre>
  <p>Inside the navbar I want the Login button to be hidden if the user is logged in.
  This is how the navbar looks like:</p>
  <pre><code>  &lt;nav class=&quot;navbar navbar-expand-sm bg-dark navbar-dark&quot;&gt;
      &lt;router-link class=&quot;navbar-brand&quot; :to=&quot;{ name: 'Home' }&quot;&gt;Home&lt;/router-link&gt;
      &lt;ul class=&quot;navbar-nav&quot;&gt;
          &lt;li class=&quot;nav-item&quot;&gt;
              &lt;router-link class=&quot;text-white&quot; :to=&quot;{ name: 'Login' }&quot; v-if=&quot;isLoggedOut&quot;&gt;Login&lt;/router-link&gt;
          &lt;/li&gt;
          &lt;li class=&quot;nav-item&quot;&gt;
              &lt;router-link class=&quot;text-white ml-2&quot; :to=&quot;{ name: 'Register' }&quot;&gt;Register&lt;/router-link&gt;
          &lt;/li&gt;
          &lt;li class=&quot;nav-item&quot;&gt;
              &lt;router-link class=&quot;text-white ml-2&quot; :to=&quot;{ name: 'Dashboard' }&quot;&gt;Dashboard&lt;/router-link&gt;
          &lt;/li&gt;
          &lt;li class=&quot;nav-item&quot;&gt;
              &lt;button class=&quot;text-white ml-2&quot; @click=&quot;logOut&quot;&gt;Logout&lt;/button&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/nav&gt;
  </code></pre>