0.0.4 • Published 3 years ago
op-error-classic v0.0.4
op-error-classic
Installation
Npm :
npm install op-error-classicYarn :
yarn add op-error-classicSetup
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 : NumberDefault : 123The error code to display (can be retrieved via error.statusCode). |
| color | Type : StringDefault : #B9B9B9The 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. |