<template>
  <div class="error-page">
    <div class="content-con">
      <img :src="src" :alt="code">
      <div class="text-con">
        <h4>{{ code }}</h4>
        <h5>{{ desc }}</h5>
      </div>
<!--      <back-btn-group btn1-text="" class="back-btn-group"></back-btn-group>-->
      <div style="text-align: right;">
        <Button size="large" type="text" @click="backHome">{{btn1Text}}</Button>
        <Button size="large" type="text" @click="backPrev">{{btn2Text}}</Button>
      </div>
    </div>
  </div>
</template>

<script>
import './error.less'
import backBtnGroup from './back-btn-group.vue'
export default {
  name: 'error_content',
  components: {
    backBtnGroup
  },
  props: {
    code: String,
    desc: String,
    src: String,
      btn1Text:{
        type:String,
        default:'返回首页'
      },
      btn1Func:{
        type:Function,
        default:()=>{return this.backHome()}
      },
      btn2Text:{
        type:String,
        default:'返回上一页'
      },
      btn2Func:{
        type:Function,
        default:()=>{return this.backPrev()}
      },
  },
  methods:{
    backHome () {
      this.$router.replace({
        name: this.$config.homeName
      })
    },
    backPrev () {
      this.$router.go(-1)
    }
  }
}
</script>
