Hi here,
I try to customise my error page, i have read this doc https://nuxtjs.org/guide/views#error-page.
The error.vue
works well but i encounter a problem with the layout property.
❯ npm -v
5.3.0
❯ node -v
v7.4.0
"nuxt": "^1.0.0-rc8"
vue init nuxt/starter error-layout
In the layouts
directory, create two files:
<template>
<div class="container">
<h1 v-if="error.statusCode === 404">Page not found</h1>
<h1 v-else>An error occurred</h1>
<nuxt-link to="/">Home page</nuxt-link>
</div>
</template>
<script>
export default {
props: ['error'],
layout: 'blog' // you can set a custom layout for the error page
}
</script>
<template>
<div>
<div>My blog navigation bar here</div>
<nuxt/>
</div>
</template>
Run:
npm run dev
Open a browser and go to http://localhost:3000/unknow-page
The text My blog navigation bar here
should be visible in the rendered content, right?
Tell me if i am wrong or if something is missing in my code
Thank you for your work 👍
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1398">#c1398</a>)</em></sub></div>