Skip to content

Commit

Permalink
Change components rendering instead of route
Browse files Browse the repository at this point in the history
  • Loading branch information
Dual-Ice committed May 21, 2020
1 parent 7b0e818 commit aa22ea6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/admin/App.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template lang="pug">
.root-container
header.header-container
Header
router-view(name="header")
nav.nav-container
Navigation
router-view(name="nav")
main.content-container
router-view

Expand Down
4 changes: 0 additions & 4 deletions src/admin/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ const router = new VueRouter({
})

router.beforeEach(async (to, from, next) => {

console.log('to ', to)
console.log('from ', from)
console.log('next ', next)
const isAuthRequired = to.matched.some(record => record.meta.auth);
const isUserLogged = store.getters["auth/isLogged"];

Expand Down
24 changes: 19 additions & 5 deletions src/admin/router/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ import About from '../components/About/About'
import Reviews from '../components/Reviews/Reviews'
import Works from '../components/Works/Works'
import Login from '../components/Login'
import Navigation from '../components/Navigation'
import Header from '../components/Header'

export default [
{
path: '/',
name: 'about',
component: About,
components: {
default: About,
nav: Navigation,
header: Header
},
meta:
{
title: "Блок «Обо мне»",
Expand All @@ -17,20 +23,28 @@ export default [
{
path: '/reviews',
name: 'reviews',
component: Reviews,
components: {
default: Reviews,
nav: Navigation,
header: Header
},
meta:
{
title: "Блок «Работы»",
title: "Блок «Отзывы»",
auth: true
}
},
{
path: '/works',
name: 'works',
component: Works,
components: {
default: Works,
nav: Navigation,
header: Header
},
meta:
{
title: "Блок «Отзывы»",
title: "Блок «Работы»",
auth: true
}
},
Expand Down

0 comments on commit aa22ea6

Please sign in to comment.