0.0.2 • Published 2 years ago

op-error-space v0.0.2

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

op-error-space

Installation

Npm :

npm install op-error-space

Yarn :

yarn add op-error-space

Setup

Nuxt.js - in ./layout/error.vue

<template>
  <!-- Use client-only to avoid server-side rendering errors -->
  <client-only>
    <op-error-space :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-space>
  </client-only>
</template>

<script>
import OpErrorSpace from 'op-error-space'
export default {
  components: { OpErrorSpace },
  layout: 'error',
  props: ['error']
}
</script>

Component props

PropDescription
error-codeType : NumberDefault : 123The error code to display (can be retrieved via error.statusCode).
background-colorType : StringDefault : #0D0D0DThe background color.

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.