<template>
  <div class="app-container">
    <div class="app-container-hd" v-if="title">
      <div class="app-container-hd__title">{{ title }}</div>
      <div class="app-container-hd__right">
        <slot name="header-right"></slot>
      </div>
    </div>
    <div class="app-container-bd">
      <slot></slot>
    </div>
    <slot name="footer"></slot>
  </div>
</template>

<script>
export default {
  name: 'AppContainer',
  props: { title: { type: String } }
}
</script>

<style lang="scss">
.app-container {
  clear: both;
}
.app-container-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  margin-bottom: 20px;
  border-bottom: 1px solid #ccc;
}
.app-container-hd__title {
  font-size: 16px;
  line-height: 45px;
}
.app-container-bd {
  margin: 0.3rem;
}
.app-container-ft {
  background-color: #fff;
  position: sticky;
  bottom: 0;
  padding-top: 30px;
  border-top: 1px solid #ccc;
}
</style>
