uni-app实现选项卡

效果图:

html

<view class="inv-h-w">
					<view :class="['inv-h',Inv==0?'inv-h-se':'']" @click="Inv=0">门诊服务</view>
					<view :class="['inv-h',Inv==1?'inv-h-se':'']" @click="Inv=1">住院服务</view>
					<view :class="['inv-h',Inv==2?'inv-h-se':'']" @click="Inv=2">便民服务</view>
				</view>
				<view class="" v-show="Inv == 0">
				
				</view>
				<view class="" v-show="Inv == 1">
				
				</view>
				<view class="" v-show="Inv == 2">
				
				</view>

css

.inv-h-w {
		/* background-color: #F2F2F2; */
		height: 100upx;
		display: flex;
		background-color: #FFFFFF;
	}

	.inv-h {
		width: 30rpx;
		font-size: 30upx;
		color: black;
		/* font-weight: 600; */
		flex: 1;
		text-align: center;
		color: black;
		height: 100upx;
		line-height: 100upx;
	}

	.inv-h-se {

		font-weight: 600;
		color: #5BA7FF;
		border-bottom: 6rpx solid #1677FF;
	}

js

export default {
		data() {
			return {
				Inv: 0
			}
		},
methods: {
			// 选项卡
			changeTab(Inv) {
				that.navIdx = Inv;
			},
		}
	}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值