Reputation: 53
Assume that Home, Login and Register links in my navigation. After login, I want to hide or remove Login and Registration Links and instead want to display Logout and Dashboard Menu.
It works when I refresh the page. What is the best way to do that programmatically?
Upvotes: 1
Views: 380
Reputation: 471
With this code you can refresh page with JavaScript:
// like an HTTP redirect
window.location.replace("/");
// like clicking on a link
window.location.href = "/";
This will redirect to your home page. If you want you can replace / with any address you want.
Upvotes: 1
Reputation: 391
You can use vue-router to specify components in each view or you can use v-if or v-show directives to programmatically change flags of code blocks.
Upvotes: 0