<!--
 * @Description:
 * @Author: 王晓颖
 * @Date:
 -->
<template>
  <div class="select-area">
    <select-title>{{ title }}</select-title>
    <div class="select-body">
      <button v-for="btn of btns" :key="btn.name" :class="{'circle-btn':btnStyle=='circle','rectangle-btn':btnStyle=='rectangle'}" class="btn">{{ btn.name }}</button>
    </div>
  </div>
</template>

<script>
import SelectTitle from './components/selectTitle'
export default {
  name: 'SelectArea',
  components: { SelectTitle },
  props: {
    title: {
      type: String,
      default: ''
    }, // 标题
    btnStyle: {
      type: String,
      default: 'circle' // circle, rectangle
    }, // 样式
    btns: {
      type: Array,
      default: () => {
        return [
          { name: '全部', value: '全部' }
        ]
      }
    }// 按钮组
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.select-area{
  width: 25rem;
  margin:1rem;
  .select-body{
    margin-top:1rem;
    font-size:0.8rem;
    .circle-btn{
      width: 3.5rem;
      height:3.5rem;
      color: white;
      background-color: transparent;
      border:1px solid #0e8bff;
      padding: 0.6rem;
      margin: 0.3rem;
      border-radius: 4rem;
    }
    .rectangle-btn{
      color: white;
      background-color: transparent;
      border:1px solid #0e8bff;
      padding: 0.5rem 0.6rem;
      margin: 0.3rem;
      border-radius: 7px;
    }
    .btn:hover{
      background-color:#0e8bff;
      cursor: pointer;
    }
    .btn:active{
      background-color:#0e8bff;
    }
    .btn:focus{
      outline: -webkit-focus-ring-color auto 0px;
      background-color:#0e8bff;
    }
  }

}
</style>
