<script setup>
const props = defineProps({
  show: {
    type: Boolean,
    default: false
  },
  title:''
})
const emit = defineEmits(['update:show'])
const close=()=>{
  emit('update:show',false)
}
</script>

<template>
  <van-popup
      :show="show"
      position="bottom"
      :style="{ height: '74%' }"
      v-bind="{...$attrs,...$props}"
      @close="close"
  >
    <div class="flex flex-col h-full">
      <!-- 固定的标题栏 -->
      <div class="flex items-center pl-16px pr-19px h-40px border-b-1px border-b-[#D3D3D3] shrink-0">
        <template v-if="$slots.title">
        <slot name="title"></slot>
        </template>
        <template v-else>
          <div class="text-#000 text-16px">{{title}}</div>
        </template>
        <div class="ml-auto flex items-center">
          <van-icon size="20" name="cross" color="#939393" @click="close"/>
        </div>
      </div>
      <!-- 可滚动的内容区域 -->
      <div class="flex-1 overflow-y-auto ">
        <slot/>
      </div>
    </div>
  </van-popup>
</template>

<style scoped>

</style>