<template>
	<view class="card_tag">
		<view class="tab_item center_in" :class="current == item.type ? 'activate_tab' :''" v-for="(item,index) in list"
			:key="index" @click="getTab(item)">{{item.title}}</view>
	</view>
</template>

<script>
	export default {
		props: {
			list: {
				type: Array,
				default: []
			},
			current: {
				type: [String, Number],
				default: ''
			}
		},
		data() {
			return {

			}
		},
		methods:{
			getTab(event){
				this.$emit('change',event)
			}
		}
	}
</script>

<style lang="scss">
	.card_tag {
		display: flex;
		width: fit-content;
		width: -webkit-fit-content;
		width: -moz-fit-content;
		border: 1rpx solid rgba(175, 148, 93, 1);
		border-radius: 40rpx;
	}

	.tab_item {
		font-size: 30rpx;
		min-width: 100rpx;
		height: 48rpx;
		color: rgba(177, 177, 177, 1);
	}

	.activate_tab {
		color: #fff;
		background-color: rgba(175, 148, 93, 1);
		border-radius: 40rpx;
	}
</style>