<template>
  <div class="page-header">
    <span class="font-size-14">{{title.name}}</span>
    <span class="ts-bord"></span>
    <div class="page-back" @click="goback" v-if="title.backName">
      <i class="el-icon-arrow-left font-size-14"></i>
      <span class="font-size-14">{{title.backName}}</span>
    </div>
  </div>
</template>

<script>
export default {
  name: 'page-header',
  props: {
    title: {
      type: Object
    }
  },
  methods: {
    goback() {
      this.$emit('goback')
    }
  }
}
</script>

<style lang="scss" scoped>
.page-header {
  padding: 20px;
  display: flex;
  position: relative;
  margin-bottom: 10px;
  .ts-bord {
    position: absolute;
    bottom: 10px;
    height: 2px;
    left: 20px;
    right: 20px;
    background: #ccccccff;
  }
  .font-size-14 {
    margin-right: auto;
    color: #222222ff;
  }
  .page-back {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-items: center;
    i,
    span {
      color: #57acffff;
    }
  }
}
</style>
