<template>
  <div class="cube-page" :class="type">
    <van-nav-bar
      :title="title"
      v-show="isHead"
      left-arrow
      @click-left="back"
    />
    <div class="wrapper">
      <section v-show="desc" class="desc"><slot name="desc">{{desc}}</slot></section>
      <main class="content">
        <slot name="content">{{content}}</slot>
      </main>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: "",
      required: true
    },
    isHead: {
      type: Boolean,
      default: false,
      required: false
    },
    type: {
      type: String,
      default: ""
    },
    desc: {
      type: String,
      default: ""
    },
    content: {
      type: String,
      default: ""
    }
  },
  methods: {
    back() {
      this.$router.back();
    }
  }
};
</script>

<style lang="less">
  //@import "~@/common/stylus/variable.styl"
  @import "~@/common/less/variable.less";
  .cube-page {
    position: absolute;
    z-index: 100;
    top: 0;
    left: 0;
    width: 100vw;
    min-height: 100vh;
    background: @nice-white;
    header {
      position: relative;
      height: 44px;
      line-height: 44px;
      text-align: center;
      background-color: #edf0f4;
      box-shadow: 0 1px 6px #ccc;
      -webkit-backface-visibility: hidden;
      backface-visibility: hidden;
      z-index: 5;
    }
    .cubeic-back {
      position: absolute;
      top: 0;
      left: 0;
      padding: 0 15px;
      color: #fc9153;
    }
    .wrapper {
      overflow: auto;
      -webkit-overflow-scrolling: touch;
    }
            
  }
</style>