uniapp实现点击切换样式

<view class="nav">
			<view v-for="(item,index) in navdata" :key="item.id"  :class="navindex==index?'itemact':'item'" @click="itemclick(index)">  ---- {{item.title}}</view>
		</view>

样式

.item{
	border: solid;
	margin: 5rpx;
	color: blue;
	
}
.itemact{
		border: solid;
	margin: 5rpx;
	color: red;
	
}

你可能感兴趣的:(uni-app,前端,javascript)