<template>
	<view>
		<view class="card_item_tooth" v-for="(item,index) in list" :key="index">
			<view class="card_wifi">
				<u-icon name="wifi" color="#2979ff" size="26"></u-icon>
				<view class="wifi_item_title">{{item.name}}</view>
			</view>
			<view>
				<u-button size="small" :type="btnType" :text="text" @click="connect(item)"></u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'x-bluetooth',
		props: {
			list: {
				type: Array,
				default () {
					return []
				}
			},
			text: {
				type: String,
				default () {
					return '连接'
				}
			},
			btnType: {
				type: String,
				default () {
					return 'primary'
				}
			},
		},
		data() {
			return {}
		},
		mounted() {},
		methods: {
			connect(value) {
				this.$emit('connect', value)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.card_item_tooth {
		padding: 20rpx 0rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.card_wifi {
		display: flex;
		align-items: center;
	}

	.wifi_item_title {
		font-size: 28rpx;
		margin-left: 16rpx;
	}
</style>