<template>
  <div class="page-container">
    <div class="page-header" v-if="$slots.header">
      <slot name="header"></slot>
    </div>
    <div class="page-content">
      <div class="page-left" v-if="$slots.left" :style="leftStyle"><slot name="left"></slot></div>
      <div class="page-right" v-if="$slots.default"><slot></slot></div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'MyPage',
  props: {
    leftStyle: [Object, String],
  }
}
</script>

<style lang="scss" scoped>
.page-container {
  display: flex;
  flex-direction: column;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  overflow: hidden;
  padding: 10px;
  .page-header {

  }
  .page-content {
    flex: 1;
    display: flex;
    overflow: hidden;

    .page-left {
      height: 100%;
      overflow: hidden;
      box-shadow: 0 0 3px rgba($color: #DDDDDD, $alpha: 1);
    }

    .page-right {
      width: 0;
      flex: 1;
      height: 100%;
      overflow-x: hidden;
      overflow-y: auto;
    }
  }
}
</style>