Added prototype of contact
This commit is contained in:
parent
928a863c13
commit
9e1084cf5f
@ -7,6 +7,7 @@
|
|||||||
<li class="menu-element"><router-link to="/">Strona główna</router-link></li>
|
<li class="menu-element"><router-link to="/">Strona główna</router-link></li>
|
||||||
<li class="menu-element"><router-link to="/projects">Projekty</router-link></li>
|
<li class="menu-element"><router-link to="/projects">Projekty</router-link></li>
|
||||||
<li class="menu-element"><router-link to="/about">O mnie</router-link></li>
|
<li class="menu-element"><router-link to="/about">O mnie</router-link></li>
|
||||||
|
<li class="menu-element"><router-link to="/contact">Kontakt</router-link></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -1,20 +1,21 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import VueRouter from 'vue-router'
|
import VueRouter from 'vue-router'
|
||||||
import Home from '../views/Home.vue'
|
import Home from '../views/Home'
|
||||||
import About from '../views/About.vue'
|
import About from '../views/About'
|
||||||
import Projects from '../views/Projects.vue'
|
import Projects from '../views/Projects'
|
||||||
|
import Contact from '../views/Contact'
|
||||||
import NotFound from '../views/NotFound'
|
import NotFound from '../views/NotFound'
|
||||||
|
|
||||||
Vue.use(VueRouter)
|
Vue.use(VueRouter)
|
||||||
|
|
||||||
const mainTitle = ' :: kamilcraft.com'
|
const mainTitle = 'kamilcraft.com'
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
name: 'Home',
|
name: 'Home',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Witam serdecznie 😊' + mainTitle
|
title: 'Witam serdecznie 😊'
|
||||||
},
|
},
|
||||||
component: Home
|
component: Home
|
||||||
},
|
},
|
||||||
@ -22,7 +23,7 @@ const routes = [
|
|||||||
path: '/projects',
|
path: '/projects',
|
||||||
name: 'Projects',
|
name: 'Projects',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Moje projekty' + mainTitle
|
title: 'Moje projekty'
|
||||||
},
|
},
|
||||||
component: Projects
|
component: Projects
|
||||||
},
|
},
|
||||||
@ -30,10 +31,18 @@ const routes = [
|
|||||||
path: '/about',
|
path: '/about',
|
||||||
name: 'About',
|
name: 'About',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'O mnie' + mainTitle
|
title: 'O mnie'
|
||||||
},
|
},
|
||||||
component: About
|
component: About
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/contact',
|
||||||
|
name: 'Kontakt',
|
||||||
|
meta: {
|
||||||
|
title: 'Kontakt'
|
||||||
|
},
|
||||||
|
component: Contact
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '*',
|
path: '*',
|
||||||
name: '404',
|
name: '404',
|
||||||
@ -47,9 +56,10 @@ const router = new VueRouter({
|
|||||||
routes
|
routes
|
||||||
})
|
})
|
||||||
|
|
||||||
const title = 'KamilCraft.com'
|
const title = ' :: ' + mainTitle
|
||||||
router.beforeEach((to, form, next) => {
|
router.beforeEach((to, form, next) => {
|
||||||
document.title = to.meta.title || title
|
const documentTitle = to.meta.title + title || mainTitle
|
||||||
|
document.title = documentTitle === to.meta.title ? title : documentTitle
|
||||||
next()
|
next()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
16
src/views/Contact.vue
Normal file
16
src/views/Contact.vue
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<template>
|
||||||
|
<div class="contact">
|
||||||
|
<h1>{{ $route.meta.title }}</h1>
|
||||||
|
<p>Witam wszystkich bardzo serdecznie!</p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'Contact'
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
Loading…
x
Reference in New Issue
Block a user