<template>
    <div>
        <header class="comhead">
            <a v-if="back" @click="goBack" class="fh">
                <img src="@/assets/images/fh.png" />
            </a>
            <h1>{{title}}</h1>
        </header>
        <div class="comheadbg"></div>
    </div>
</template>
<script>
export default {
    name:'HeaderNormal',
    props:{
        title:{
            type:String,
            default:''
        },
        back:{
            type:Boolean,
            default:true
        },
        back_layer:{
            type:Number,
            default:-1
        },
        OnBack:{
            type:Function,
            default:null
        }
    },
    methods:{
       goBack(){
           if(typeof this.OnBack==='function') {
               if(this.OnBack()) {
                   this.base.goBack(this,this.back_layer)
               }
           } else {
               this.base.goBack(this,this.back_layer)
           }
       },
    }
}
</script>