dynamic-border.uvue 944 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
<template>
	<view style="margin: 15px;border-radius: 10px;background-color: white;">
		<view
			v-for="(item,index) in 10" :key="index"
			:class="(index < 9 ? 'bb1' : '') + ' ' + (currentIndex == 0 ? 'btlr10 btrr10' : currentIndex == 9 ? 'bblr10 bbrr10' : '')"
			style="flex-direction: row;align-items: center;padding: 15px"
			:style="index == currentIndex ? 'background-color :#57BE6A;' : ''"
			@tap="currentIndex = index">
			<view>
				<text style="font-size: 14px;" :style="index == currentIndex ? 'color: #FFFFFF;' : ''">{{index + 1}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				currentIndex: 0,
			}
		}
	}
</script>

<style>
	.bb1{
		border-bottom: 1rpx solid #EEEEEE;
	}
	.btlr10{
		border-top-left-radius: 10rpx;
	}
	.btrr10{
		border-top-right-radius: 10rpx;
	}
	.bblr10{
		border-bottom-left-radius: 10rpx;
	}
	.bbrr10{
		border-bottom-right-radius: 10rpx;
	}
</style>