layout-content.vue 1.22 KB
<template>
  <div class="layout-content">
    <div class="layout-header">
      <i-breadcrumb>
        <i-breadcrumb-item >Home首页</i-breadcrumb-item>
        <i-breadcrumb-item :to="bread.url" v-for="(bread, inx) in breads" :key="inx">{{bread.title}}</i-breadcrumb-item>
      </i-breadcrumb>
    </div>
    <div class="layout-box">
      <i-card class="layout-card">
        <div class="layout-card-content">
          <slot></slot>
        </div>
      </i-card>
    </div>
  </div>
</template>

<script>
export default {
  name: 'LayoutContent',
  props: {
    breads: {
      type: Array,
      default() {
        return [];
      }
    }
  }
};
</script>

<style lang="scss" scoped>
.layout-content {
  width: 100%;
  height: 100%;
  background: #f5f7f9;
  display: flex;
  flex-direction: column;

  .layout-header {
    height: 64px;
    line-height: 64px;
    background: #fff;
    padding: 0 20px;
  }

  .layout-box {
    width: 100%;
    height: 100%;
    padding: 18px;
    flex: 1;
    overflow: hidden;
  }

  .layout-card {
    height: inherit;

    & > /deep/.ivu-card-body {
      height: inherit;
    }

    .layout-card-content {
      height: inherit;
      display: flex;
      flex-direction: column;
    }
  }
}
</style>