After creating a login page and setting conditions to display different NAVBARs based on the user's login status, I encountered an issue where the rendering seemed to be delayed. In the login process, I utilized local storage to store a token for authentication purposes. However, I was puzzled as to why the rendering behavior was delayed in displaying the appropriate NAVBAR.
Below is an excerpt from my code in app.vue:
<v-main>
<NavA v-if="token==='' "/> // Display Nav A if not logged in
<NavB v-if="token!='' "/> // Display Nav B if login successful
<router-view />
</v-main>
data: () => ({
drawer: true,
token: '',
}),
mounted () {
this.token = localStorage.getItem('token')
},