<template>
  <view class="choosesizeTop">
      <view :class="select[0]" @click="choose" data-type="1">车型适配</view>
      <view :class="select[1]" @click="choose" data-type="2">自选规格</view>
  </view>
</template>

<script>
export default {
name:"choosesizeTop",
data(){
    return {
        select:['select','selected'],
        leixing:2
    }
},
methods:{
    choose(e){
        this.leixing=e.currentTarget.dataset.type
        if(this.leixing==1){
            this.select=['selected','select']
        }else{
            this.select=['select','selected']
        }
         this.$emit('changes',this.leixing);
    }
}
}
</script>

<style lang="scss">
.choosesizeTop{
    height: 78upx;
    background-color: white;
    border-bottom: 2upx solid #EEEEEE;
    display: flex;
      
        font-size:  26upx;
        text-align: center;
        line-height: 78upx;
    .select{
        width: 380upx;
      color: #666666;
    }
        .selected{
        width: 370upx;
      color:#E68645;
      border-bottom: 2upx solid #E68645
    }
}
</style>