Answer the question
In order to leave comments, you need to log in
Different templates for vue-router?
The site has content pages and login and registration pages. So for the content, a certain static part with a header, footer and menu is used, but for the entrance and registration, another static part is needed. How to do this with vue-router?
Entry point
Router Is
it possible to write something in the component itself so that it uses a different template? If not, then how to do it at all?
Answer the question
In order to leave comments, you need to log in
You can hide the header, footer and menu by checking $route.path, $route.name or by meta data (which will be more correct) $router.meta
export default new Router({
routes: [
{
path: '/signin',
component: SignIn
meta: { hideHeader: true }
}
]);
<header v-if="!$route.meta.hideHeader">
...
I use https://github.com/ktquez/vue-extend-layout for your task. And no need to invent bicycles
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question