<template>
  <el-drawer
    ref="t2"
    :visible.sync="visible"
    :append-to-body="false"
    :modal-append-to-body="false"
    :modal="false"
    :show-close="false"
    style="position: absolute; z-index: -1; bottom: 0"
    direction="rtl"
    size="100%"
    custom-class="sub-drawer"
    v-bind="$attrs"
    v-on="$listeners"
    @closeDrawer="closeDrawer"
  >
    <template slot="title">
      <el-page-header :content="title" @back="closeDrawer" />
    </template>
    <div v-if="visible" class="app-container layout-vertical">
      <slot ref="t3" />
    </div>
  </el-drawer>
</template>

<script>
export default {
  name: 'SubDrawer',
  model: {
    prop: 'visible',
    event: 'update:visible'
  },
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: '明细'
    }
  },
  data() {
    return {}
  },
  watch: {
    visible(val) {
    }
  },
  methods: {
    // 返回刷新
    closeDrawer() {
      this.$emit('update:visible', false)
    },
    proxyTable(data) {
      console.log(this.$refs, 'daili')
    }

  }
}
</script>

<style lang="scss" scoped>
::v-deep .el-page-header {
  line-height: 20px;
}

::v-deep .el-page-header__content {
  font-size: 14px !important;
}

::v-deep .sub-drawer .el-drawer__header {
  padding: 8px 20px;

  box-shadow: inset 0 1px 0 0 #e4e7ed;

  font-size: 14px;
  line-height: 20px;
}

::v-deep .el-drawer__body {
  background-color: #f0f2f5;
}
</style>
