<template>
  <div class="train-chunk-box">
    <div class="train-chunk-title ellipsis-1">
      <span class="ellipsis-1" style="flex: 1">{{ title }}</span>
      <slot name="title-left"></slot>
    </div>
    <div class="train-chunk-content">
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: '默认标题'
    }
  }
}
</script>

<style lang="scss" scoped>
.train-chunk-box {
  flex: 1;
  width: 100%;
  padding: 0 10px 10px 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  .train-chunk-title {
    height: 30px;
    width: 100%;
    background-color: #208ac6;
    border-radius: 10px 10px 0 0;
    line-height: 30px;
    padding: 0 10px;
    color: white;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .train-chunk-content {
    // flex: 1;
    width: 100%;
    background-color: #f2fafc;
    overflow: auto;
    height: calc(100% - 30px);

  }
}
</style>
