mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 17:37:14 +00:00
b11e9c0e51
- [ ] babel-eslint https://github.com/babel/babel-eslint/issues/664 - [x] eslint-config-standard-jsx https://github.com/standard/eslint-config-standard-jsx/issues/32 - [x] eslint-config-standard to be stable release https://github.com/standard/eslint-config-standard/issues/123 - [x] eslint-plugin-html - [x] eslint-plugin-import - [x] eslint-plugin-jest - [x] eslint-plugin-node - [x] eslint-plugin-promise - [x] eslint-plugin-standard https://github.com/standard/eslint-plugin-standard/issues/29 - [x] eslint-plugin-vue https://github.com/vuejs/eslint-plugin-vue/pull/504 - [x] eslint-plugin-react https://github.com/yannickcr/eslint-plugin-react/releases/tag/v7.10.0
94 lines
1.9 KiB
Vue
94 lines
1.9 KiB
Vue
<template>
|
|
<div>
|
|
<header class="Header">
|
|
<div class="container">
|
|
<h1 class="Header__Title">Nuxt i18n</h1>
|
|
<nav class="Header__Menu">
|
|
<nuxt-link :to="$i18n.path('')" class="Header__Link" exact>
|
|
{{ $t('links.home') }}
|
|
</nuxt-link>
|
|
<nuxt-link :to="$i18n.path('about')" class="Header__Link" exact>
|
|
{{ $t('links.about') }}
|
|
</nuxt-link>
|
|
<nuxt-link v-if="$i18n.locale === 'en'" :to="`/fr` + $route.fullPath" class="Header__Link" active-class="none" exact>
|
|
{{ $t('links.french') }}
|
|
</nuxt-link>
|
|
<nuxt-link v-else :to="$route.fullPath.replace(/^\/[^\/]+/, '')" class="Header__Link" active-class="none" exact>
|
|
{{ $t('links.english') }}
|
|
</nuxt-link>
|
|
</nav>
|
|
</div>
|
|
</header>
|
|
<nuxt />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {}
|
|
</script>
|
|
|
|
<style>
|
|
*, *:before, *:after {
|
|
padding: 0;
|
|
margin: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
html, body {
|
|
background-color: #fff;
|
|
color: #2e2f30;
|
|
letter-spacing: 0.5px;
|
|
font-size: 18px;
|
|
font-family: "Source Sans Pro", Arial, sans-serif;
|
|
height: 100vh;
|
|
margin: 0;
|
|
}
|
|
.container {
|
|
width: 75%;
|
|
margin: 0 auto;
|
|
}
|
|
.container:after {
|
|
content: "";
|
|
display: table;
|
|
clear: both;
|
|
}
|
|
.Header {
|
|
color: #fff;
|
|
height: 80px;
|
|
line-height: 80px;
|
|
background-color: #2e2f30;
|
|
}
|
|
.Header__Title {
|
|
float: left;
|
|
font-weight: 300;
|
|
font-size: 30px;
|
|
}
|
|
.Header__Menu {
|
|
float: right;
|
|
}
|
|
.Header__Link {
|
|
font-size: 16px;
|
|
color: #fff;
|
|
border: 1px solid #fff;
|
|
padding: 7px 12px;
|
|
text-transform: uppercase;
|
|
text-decoration: none;
|
|
border-radius: 5px;
|
|
margin-left: 10px;
|
|
}
|
|
.Header__Link:hover {
|
|
color: #2e2f30;
|
|
background-color: #fff;
|
|
}
|
|
.nuxt-link-active {
|
|
color: cyan;
|
|
}
|
|
.Content {
|
|
padding: 50px 0;
|
|
text-align: center;
|
|
}
|
|
.Content__Title {
|
|
font-weight: 300;
|
|
padding-bottom: 30px;
|
|
}
|
|
</style>
|