op-error-classic
v0.0.4
Published
Vue.js error page component designed for Nuxt.js by Optic Performance™
Downloads
3
Readme
op-error-classic
Installation
Npm :
npm install op-error-classic
Yarn :
yarn add op-error-classic
Setup
Nuxt.js - in ./layout/error.vue
<template>
<!-- Use client-only to avoid server-side rendering errors -->
<client-only>
<op-error-classic :error-code="error.statusCode">
<template #info-message>
Powered by Optic Performance™
</template>
<template #redirect-message>
Consider redirecting your user
<nuxt-link to="https://www.optic-performance.com/">somewhere</nuxt-link>
</template>
</op-error-classic>
</client-only>
</template>
<script>
import OpErrorClassic from 'op-error-classic'
export default {
components: { OpErrorClassic },
layout: 'error',
props: ['error']
}
</script>
Component props
| Prop | Description |
|------------|-------------|
| error-code |Type : Number
Default : 123
The error code to display (can be retrieved via error.statusCode
).|
| color |Type : String
Default : #B9B9B9
The main color that will be applied to the theme.|
Component slots
| Slot | Description |
|------------|-------------|
| #info-message |A message to explain the problem.|
| #redirect-message |A message to redirect the user. This slot is intended to display a link with a <a>
or a <nuxt-link>
tag.|