I'm trying to build a site that centers around a dashboard and has a sidebar and a navbar.
The code here is what I use in my "App.vue" file:
<template>
<v-app>
<core-filter></core-filter>
<core-toolbar v-if="$route.name !== 'Login'"></core-toolbar>
<core-drawer v-if="$route.name !== 'Login'"></core-drawer>
<core-view></core-view>
</v-app>
</template>
This code works fine, but it isn't quick enough. When I go to the login page, I see the sidebar (drawer) and the navbar (toolbar) flash before disappearing. It's obvious something is disappearing, especially as the sidebar displaces the main content. You see something flash on the left and then the page content shifts over to be in (the new) center of the page.
Is there a better way to decide what elements should be shown? Is this even an acceptable way to do layouts?
v-showinstead ofv-if, this way layout engine in browser wouldn't have to think too much (events unpinning, destroying hooks, garbage collecting and so on). This is the real way to hide element,v-ifremoves it completely from the dom, not just hides.