Answer the question
In order to leave comments, you need to log in
How to implement this through vue routes?
There is a template (I don’t know how to name it correctly) and it contains a point for components (router-view). How can I make the /register and /login routes open in this template (I already did it), and for example /app without this template?
Answer the question
In order to leave comments, you need to log in
Option 2:
1) Connect the required template component in the page components. That is, in your case, in those components that are shown on the /register and /login routes, add a template component.
<template>
<layout-custom>
<!-- тут код компонентов -->
</layout-custom>
</template>
router-view
, but slot
. const router = new Router({
routes: [
{
// Без шаблона
path: '/app',
component: AppPage,
},
{
// С шаблоном
path: '/',
component: LayoutCustom,
children: [
{
path: '/register',
component: RegisterPage,
},
{
path: '/login',
component: LoginPage,
}
],
},
],
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question