<template>
  <div class="wrapper">
  	<img src="/images/default.jpg">
  	<div v-if='error.statusCode==404'>
  		<h2>{{ error.statusCode }} 找不到指定页面</h2>
  		<div>
  			<a href="javascript:history.back()">返回上一页</a>
  		</div>
  	</div>
	
	<div v-if='error.statusCode!=404'>
		<h2>{{ error.statusCode }} 发现未知错误</h2>
		<div>
			<nuxt-link to="/">返回首页</nuxt-link>
		</div>
	</div>
  </div>
</template>

<script>
  export default {
    props: ['error'],
    layout: 'error',
	created(){

	},
	method:{
		backToLastPage(){
			window.history.back();
		},
		backToHome(){
			window.location.href="/";
		}
	}
  }
</script>
<style lang="less" scoped >
html,body{
			width:100%;
			height:100%;
			overflow:hidden;
		}
		.wrapper{
			width:100%;
			height:100%;
			display:flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			text-align: center;
		}
		h2{
			font-size: 2.5rem;
			line-height: 3.5rem;
			color:#e2001a;
		}
		a{
			color:#666;
			text-decoration: none;
			padding-bottom:.25rem;
			border-bottom: 1px solid #666;
		}
		a:hover {
			color:#e2001a;
			border-color: #e2001a;
		}
</style>