4👍
✅
In your created method change to:
created () {
this.user = firebase.auth().currentUser || false;
}
Also make sure user
is in your data
method.
Then check user in your view.
<ul>
...
<li v-if="user">Log Out</li>
<li v-else>Register</li>
...
</ul>
As you go on, you want to abstract out the menu into a component so you’re not repeating this same code throughout each page.
Source:stackexchange.com