<template>
  <van-popup
    class="base-popup"
    v-model="visible"
    closeable
    round
    @closed="$emit('closed')"
    close-icon-position="top-left"
    position="bottom"
    :style="{ height: '80%' }"
  >
    <div class="title">
      {{ title }}
    </div>
    <div class="content">
      <slot />
    </div>
  </van-popup>
</template>

<script lang="ts">
import { Vue, Component, Prop, PropSync } from 'vue-property-decorator';
@Component({})
export default class BasePopup extends Vue {
  @PropSync('show') private visible!: boolean;
  @Prop() private title!: string;
}
</script>

<style lang="scss" scoped>
.base-popup {
  .title {
    margin-top: 16px;
    margin-bottom: 24px;
    text-align: center;
    font-size: 16px;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
    color: #353535;
    line-height: 22px;
  }
  .content {
    height: calc(100% - 16px - 24px - 22px);
    overflow: auto;
  }
}
</style>
