<!--
 * @Description: 
 * @Author: Format-qi 283810417@qq.com
 * @Date: 2022-06-25 15:47:45
 * @LastEditors: Format-qi 283810417@qq.com
 * @LastEditTime: 2022-06-29 18:27:26
-->
<template>
  <div :class="[`${prefixCls}__header px-2 py-5`, $attrs.class]">
    <BzTitle :helpMessage="helpMessage" normal>
      <template v-if="title">
        {{ title }}
      </template>
      <template v-else>
        <slot name="title"></slot>
      </template>
    </BzTitle>
    <div :class="`${prefixCls}__action`">
      <slot name="action"></slot>
      <BzArrow v-if="canExpan" up :expand="show" @click="$emit('expand')" />
    </div>
  </div>
</template>
<script lang="ts">
  export default {
    name: 'CollapseContainer',
    inheritAttrs: false,
  };
</script>
<script lang="ts" setup>
  import { BzArrow, BzTitle } from '/@/components/Basic';
  defineProps({
    prefixCls: { type: String },
    helpMessage: {
      type: [Array, String] as PropType<string[] | string>,
      default: '',
    },
    title: { type: String },
    show: { type: Boolean },
    canExpan: { type: Boolean },
  });
  defineEmits(['expand']);
</script>
