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="/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="/contact">Kontakt</router-link></li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -1,20 +1,21 @@
|
||||
import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
import Home from '../views/Home.vue'
|
||||
import About from '../views/About.vue'
|
||||
import Projects from '../views/Projects.vue'
|
||||
import Home from '../views/Home'
|
||||
import About from '../views/About'
|
||||
import Projects from '../views/Projects'
|
||||
import Contact from '../views/Contact'
|
||||
import NotFound from '../views/NotFound'
|
||||
|
||||
Vue.use(VueRouter)
|
||||
|
||||
const mainTitle = ' :: kamilcraft.com'
|
||||
const mainTitle = 'kamilcraft.com'
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'Home',
|
||||
meta: {
|
||||
title: 'Witam serdecznie 😊' + mainTitle
|
||||
title: 'Witam serdecznie 😊'
|
||||
},
|
||||
component: Home
|
||||
},
|
||||
@ -22,7 +23,7 @@ const routes = [
|
||||
path: '/projects',
|
||||
name: 'Projects',
|
||||
meta: {
|
||||
title: 'Moje projekty' + mainTitle
|
||||
title: 'Moje projekty'
|
||||
},
|
||||
component: Projects
|
||||
},
|
||||
@ -30,10 +31,18 @@ const routes = [
|
||||
path: '/about',
|
||||
name: 'About',
|
||||
meta: {
|
||||
title: 'O mnie' + mainTitle
|
||||
title: 'O mnie'
|
||||
},
|
||||
component: About
|
||||
},
|
||||
{
|
||||
path: '/contact',
|
||||
name: 'Kontakt',
|
||||
meta: {
|
||||
title: 'Kontakt'
|
||||
},
|
||||
component: Contact
|
||||
},
|
||||
{
|
||||
path: '*',
|
||||
name: '404',
|
||||
@ -47,9 +56,10 @@ const router = new VueRouter({
|
||||
routes
|
||||
})
|
||||
|
||||
const title = 'KamilCraft.com'
|
||||
const title = ' :: ' + mainTitle
|
||||
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()
|
||||
})
|
||||
|
||||
|
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