I am having trouble understanding the logic behind how the v-if works. I am trying to hide buttons in the nav based on what page the user is on or if they are authenticated. I basically want the my-account button to show when the user has logged in and show the sign-up/log-in buttons when they are not PLUS if the user is on the "activate my account" page I dont want any buttons in the nav. As you can see I have tried adding a method which returns the path of the activation page. The problem is when the following code is uncommented it hides the sign-up/login buttons but also for the my-account page.
<template v-else-if="isNotInConfig">
</template>
Heres what I have so far:
<div class="navbar-end">
<div class="navbar-item">
<div class="buttons">
<template v-if="$store.state.user.isAuthenticated">
<router-link to="/dashboard/my-account" class="button is-primary is-outlined">My account</router-link>
</template>
<!-- <template v-else-if="isNotInConfig">
</template> -->
<template v-else>
<router-link to="/sign-up" class="button is-primary" ><strong>Sign up</strong></router-link>
<router-link to="/log-in" class="button is-light">Log in</router-link>
</template>
</div>
</div>
</div>
<script>
export default {
data() {
return {
}
},
methods: {
isNotInConfig() {
return this.$router.history.current["path"] == "/activate/:uid/:token";
}
},
};
</script>