<template>
  <v-card ref="card" :height="height" class="elevation-5 mb-3" :style="`z-index: ${zIndex};top: ${myTop}px`">
    <slot></slot>
  </v-card>
</template>

<script>
export default {
  name: 'header-panel',
  props: {
    height: {
      type: [Number, String],
      default: 80
    },
    top: {
      type: [Number, String],
      default: 188
    },
    zIndex: {
      type: [Number, String],
      default: 999
    },
    // 是否使用自定义的top
    customTop: {
      type: Boolean,
      default: false
    }
  },
  data () {
    return {
      myTop: 0
    }
  },
  mounted () {
    this.$nextTick(() => {
      if (this.customTop) {
        this.myTop = this.top
        return
      }
      this.myTop = this.$refs.card.$el.offsetTop
    })
  }
}
</script>

<style lang="scss" scoped>

</style>
