wblteam
wblteam

Reputation: 53

Refreshing Navigation In VUEJS

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

Answers (2)

Roozbeh
Roozbeh

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

Sebastian Schulz
Sebastian Schulz

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

Related Questions