I'm using Materialize CSS to design my web app, and I want to display the links based on whether or not a user is authenticated. I can easily check this, but when I add a v-if to my dropdown button, it no longer works.
Here's my code:
<template>
<ul id="account" class="dropdown-content" v-if="auth">
<li><a href="#!" class="black-text"><i class="material-icons right">check_circle</i>Link 1</a></li>
<li><a href="#!" class="black-text"><i class="material-icons right">folder</i>Link 2</a></li>
<li><a href="#!" class="black-text"><i class="material-icons right">settings</i>Link 3</a></li>
</ul>
<nav class="white" role="navigation">
<div class="nav-wrapper container black-text">
<ul class="right hide-on-med-and-down">
<li><a v-if="auth" class="dropdown-button" data-activates="account">{{ auth.first_name }} {{ auth.last_name }}<i class="material-icons right">arrow_drop_down</i></a></li>
<li><a v-if="auth"><i class="material-icons right">exit_to_app</i>Logout</a></li>
<div v-if="!auth">
<li>
<a v-link="{ name: 'registration' }">
<i class="material-icons right">create</i>
Sign Up
</a>
</li>
<li>
<a v-link="{ name: 'authentication' }">
<i class="material-icons right">fingerprint</i>
Login
</a>
</li>
</div>
</ul>
</div>
</nav>
</template>
If I remove the v-ifs, the dropdown opens and closes successfully. I've event looked in the Chrome code inspector, and the code appears but fails to work.
I've also suspected that the classes needed to be bound using v-bind, but this did not help at all.