<template>
  <div class="main-container" style="padding:50px">
    <h1 v-if="error.statusCode === 404">Page not found</h1>
    <h1 v-else>An error occurred</h1>
    <NuxtLink to="/">返回首页</NuxtLink>
  </div>
</template>

<script>
export default {
  props: ['error'],
  layout: 'error',
  middleware: [
    function ({ redirect }) {
      return redirect(301, '/el?e=rnf')
    }
  ]
}
</script>