Remove pages/_error-debug.vue

This commit is contained in:
Sébastien Chopin 2016-11-25 17:56:46 +01:00
parent cb1994319c
commit 05372d9068
2 changed files with 2 additions and 72 deletions

View File

@ -1,67 +0,0 @@
<template>
<div class="error-page">
<div>
<h1 class="error-code">{{ error.statusCode }}</h1>
<div class="error-wrapper-message">
<h2 class="error-message">{{ error.message }}</h2>
</div>
<pre v-if="error.stack">{{ error.stack }}</pre>
<p v-if="error.statusCode === 404"><router-link class="error-link" to="/">Back to the home page</router-link></p>
</div>
</div>
</template>
<script>
export default {
name: 'nuxt-error',
props: ['error'],
head () {
return {
title: this.error.message || 'An error occured'
}
}
}
</script>
<style scoped>
.error-page {
color: #000;
background: #fff;
top: 0;
bottom: 0;
left: 0;
right: 0;
position: absolute;
font-family: "SF UI Text", "Helvetica Neue", "Lucida Grande";
text-align: center;
padding-top: 20%;
}
.error-code {
display: inline-block;
font-size: 24px;
font-weight: 500;
vertical-align: top;
border-right: 1px solid rgba(0, 0, 0, 0.298039);
margin: 0px 20px 0px 0px;
padding: 10px 23px;
}
.error-wrapper-message {
display: inline-block;
text-align: left;
line-height: 49px;
height: 49px;
vertical-align: middle;
}
.error-message {
font-size: 14px;
font-weight: normal;
margin: 0px;
padding: 0px;
}
.error-link {
color: #00BCD4;
font-weight: normal;
text-decoration: none;
font-size: 14px;
}
</style>

View File

@ -182,7 +182,7 @@ function * generateRoutesAndFiles () {
transition: this.options.transition,
components: {
Loading: r(__dirname, '..', 'app', 'components', 'nuxt-loading.vue'),
ErrorPage: r(__dirname, '..', 'app', 'components', (this.dev ? 'nuxt-error-debug.vue' : 'nuxt-error.vue'))
ErrorPage: r(__dirname, '..', 'app', 'components', 'nuxt-error.vue')
}
}
if (templateVars.loading === 'string' && templateVars.loading.slice(-4) !== '.vue') {
@ -200,10 +200,7 @@ function * generateRoutesAndFiles () {
if (files.includes('pages/_app.vue')) {
templateVars.appPath = r(this.dir, 'pages/_app.vue')
}
if (this.dev && files.includes('pages/_error-debug.vue')) {
templateVars.components.ErrorPage = r(this.dir, 'pages/_error-debug.vue')
}
if (!this.dev && files.includes('pages/_error.vue')) {
if (files.includes('pages/_error.vue')) {
templateVars.components.ErrorPage = r(this.dir, 'pages/_error.vue')
}
let moveTemplates = templatesFiles.map((file) => {