refactor(Header): separated header into its own component

This commit is contained in:
Resi Respati 2017-04-21 15:12:20 +07:00
parent 92882ce196
commit 49dbd5ad9a
No known key found for this signature in database
GPG Key ID: BB70B066307F92FD
2 changed files with 24 additions and 6 deletions

View File

@ -1,7 +1,7 @@
<template>
<div id="app">
<div class="container">
<h1 class="title">tilde<strong>tv</strong></h1>
<app-header></app-header>
<router-view></router-view>
<footer>
<router-link to="/">home</router-link>
@ -11,8 +11,13 @@
</template>
<script>
import Header from './components/Header.vue'
export default {
name: 'app'
name: 'app',
components: {
'app-header': Header
}
}
</script>
@ -65,8 +70,4 @@ a:focus {
margin-left: auto;
margin-right: auto;
}
.title {
font-weight: 400;
}
</style>

17
src/components/Header.vue Normal file
View File

@ -0,0 +1,17 @@
<template>
<header>
<h1 class="title">tilde<strong>tv</strong></h1>
</header>
</template>
<script>
export default {
name: 'app-header'
}
</script>
<style scoped>
.title {
font-weight: 400;
}
</style>