<template>
	<view class="content">
		<view class="levelList_i" :class="tabActive == item.path ? 'act' : ''" v-for="(item, index) in topList"
			:key="index" @click.prevent="handleLink(item)">
			{{ item.name }}

		</view>
	</view>
</template>

<script>
	export default {
		name: "topBar",
		props: {
			topList: {
				type: Array,
			},
			moren: {
				type: String,
				default: ""
			}
		},
		data() {
			return {
				tabActive: this.moren,
			};
		},
		methods: {
			handleLink(item) {
				this.tabActive = item.path;
				uni.navigateTo({
					url: item.path
				})
			},
		}
	}
</script>

<style lang="scss" scope>
	.content {
		background-color: #ffffff;
		align-items: center;
		display: flex;
		padding: 27rpx 0;

		.levelList_i {
			min-width: 200rpx;
			height: 60rpx;
			border: 2rpx solid #DDDDDD;
			display: flex;
			align-items: center;
			justify-content: center;
			cursor: pointer;
			border-radius: 30rpx;
			font-size: 30rpx;
			line-height: 34rpx;
			margin: 0 22rpx;
		}


		.act {
			color: #FFFFFF;
			background: #C8161D;

		}

		.act1 {
			border-bottom: 3rpx solid #1890ff !important;
		}

		.cha {
			font-size: 16rpx;
			color: #606266;
			position: absolute;
			top: 10rpx;
		}

		.li {
			width: 40rpx;
			margin: 0 auto;
			border-bottom: 3rpx solid transparent;

		}
	}
</style>
