0.0.4 • Published 2 years ago

op-error-classic v0.0.4

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

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

PropDescription
error-codeType : NumberDefault : 123The error code to display (can be retrieved via error.statusCode).
colorType : StringDefault : #B9B9B9The main color that will be applied to the theme.

Component slots

SlotDescription
#info-messageA message to explain the problem.
#redirect-messageA message to redirect the user. This slot is intended to display a link with a <a> or a <nuxt-link> tag.