<template>
  <div class="split-line">
    <div v-if="isOpen" class="btns">
      <div v-if="flag" @click="open">
        更多筛选<i class="bi bi-chevron-down" />
      </div>
      <div v-else @click="close">
        收起筛选<i class="bi bi-chevron-up" />
      </div>
    </div>
  </div>
</template>
<script lang="ts" setup>
import { defineProps,  ref, reactive } from 'vue'
// 定义父组件的传参和类型
const props = defineProps({
  isOpen: { type: Boolean, default: false },
  flag: { type: Boolean, default: true }
})

const emit = defineEmits(['open', 'close'])
const open =(e)=> emit('open')
const close =(e)=> emit('close')

</script>
<style scoped lang="less">
.split-line {
  border-bottom: 1px solid #ebeff2;
  position: relative;
  -webkit-touch-callout: none; 
  user-select: none; 
}

.btns {
  width: 100px;
  height: 34px;
  cursor: pointer;
  border: 1px solid #ebeff2;
  border-radius: 5px;
  position: absolute;
  left: 50%;
  margin-left: -50px;
  top: 50%;
  margin-top: -17px;
  background-color: #fff;
  font-size: 12px;

  div {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    color: #79807E;
  }
}
.btns::before {
  content: '';
  position: absolute;
  width: calc(100% + 2px);
  height: 50%;
  background-color: #fff;
  top: -1px;
  left: -1px;
  z-index: 1;
}

i {
  display: inline-block;
  margin-left: 5px;
}
.bi-chevron-up::before,  .bi-chevron-down::before{
  font-size: 6px;
}

</style>