<template>
  <div class="page-header">
    <div class="page-title">
      <slot />
    </div>
    <div class="page-buttons">
      <el-button size="mini" type="default" @click="pageBack">返回</el-button>
      <slot name="buttons" />
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    pageBack() {
      this.$router.go(-1);
    },
  },
};
</script>

<style lang="scss">
.page-header {
  background: #fff;
  padding: 10px 0 4px;
  box-shadow: 0 2px 3px #e3e3e3;
  .page-buttons {
    padding: 0 20px;
  }
  .page-title {
    margin: 0;
    font-size: 18px;
    text-align: center;
    font-weight: 600;
  }
}
</style>
