layout-app.vue 950 Bytes
<template>
  <div class="layout">
    <slot name="header">
      <LayoutHeader
        class="layout-header"
        :title="title"
        :opacity="opacity"
        :show-back="showBack"
      ></LayoutHeader>
    </slot>

    <div class="layout-context" :class="{ fixscroll: this.fixscroll }">
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: "LayoutApp",
  props: {
    title: String,
    opacity: {
      type: Number,
      default: 1
    },
    fixscroll: {
      type: Boolean,
      default: false
    },
    showBack: {
      type: Boolean,
      default: true
    }
  }
};
</script>

<style lang="scss">
.layout {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  font-size: 24px;
  display: flex;
  flex-direction: column;

  .layout-context {
    flex: 1;
    overflow: hidden;
    position: relative;
  }

  .fixscroll {
    overflow: scroll;
  }
}
</style>