<template>
   <div class="cpr_header">
        <div class='left'>
            <div @click="goback()">
                <app-icon name='icon-fanhui' size='18px' color='#2B446C'></app-icon> 
            </div>
        </div>
        <div class='center'>{{title}}</div>
        <div class='right'>
            <slot></slot>
        </div>
   </div>
</template>

<script lang='ts'>
/**框架*/
import Vue from 'vue'
/**工具库*/
/**类型*/
/**组件*/
/**自定义方法*/

export default Vue.extend({
   name:'',
   props: {
       backPath: {
           type: String
       },
       title:{
           required: true,
           type: String
       }
   },
   components:{
       'app-icon':()=>import('@/components/common/Icon.vue')
   },
   methods:{
        goback(){
            if(this.backPath) {
            }else {
                history.go(-1)
            }
            this.$emit('onBack')
        }
   }
})
</script>

<style scoped lang='less'>
.cpr_header {
    display: flex;
    height: 40px;
    align-items: center;
    justify-content: space-between;
    color: #2B446C;
    .center {
        font-size: 18px;
    }
}
</style>