Nuxt/lib/app/components/nuxt-error.vue
2017-08-05 14:54:12 +04:30

71 lines
1.8 KiB
Vue

<template>
<div class="__nuxt-error-page">
<div class="container">
<div class="row">
<div class="column">
<h1>{{ error.statusCode }} </h1>
<h4> {{ $route.path }} </h4>
<pre class="error-box"><code>{{ error.message }}</code></pre>
<p v-if="error.statusCode === 404">
<nuxt-link class="error-link" to="/">Back to the home page</nuxt-link>
</p>
</div>
</div>
<div class="row">
<div class="column">
<div class="poweredby">
<small> Powered by <a href="https://nuxtjs.org">Nuxt.js</a> </small>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'nuxt-error',
props: ['error'],
head () {
return {
title: this.error ? ((this.error.statusCode || 500) + ' - ' + (this.error.message || 'Error')) : '500 - Error',
link: [
{ rel: 'stylesheet', href: 'https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css', type: 'text/css', media: 'all' },
{ rel: 'stylesheet', href: 'https://cdnjs.cloudflare.com/ajax/libs/milligram/1.3.0/milligram.min.css', type: 'text/css', media: 'all' }
]
}
}
}
</script>
<style>
.__nuxt-error-page {
background: #edecea;
font-size: 1em;
word-spacing: 1px;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
}
.__nuxt-error-page .container {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 100vw;
height: 100vh;
}
.__nuxt-error-page .error-box {
box-shadow: 0px 0px 9px #d3d3d3;
padding: 10px;
}
.__nuxt-error-page .poweredby {
text-align: center;
margin-top: 10%;
}
</style>