<button type="default" :class="[isDay?'nextbtn':'custombtn']" @click="onedata()">本日</button>
<button type="default" :class="[isWeek?'nextbtn':'custombtn']" @click="sevendata()">本周</button>
isDay:true,
isWeek:false,
点击切换
this.isWeek=false
this.isDay=true
两种样式
.nextbtn{
display: inline-block;
width: 170rpx;
height: 50rpx;
line-height: 50rpx;
margin-bottom: 30rpx;
margin-right: 30rpx;
color: #fff;
font-size: 22rpx;
border-radius: 50rpx;
box-shadow: 0px 3px 12px 0px rgba(146, 146, 146, 0.25);
background: linear-gradient(90deg, #4690FE, #4690FE);
border: 0;
&::after {
display: none;
}
}
.custombtn{
display: inline-block;
width: 150rpx;
height: 50rpx;
line-height: 50rpx;
margin-bottom: 30rpx;
margin-right: 30rpx;
color: #999;
font-size: 22rpx;
border-radius: 50rpx;
box-shadow: 0px 3px 12px 0px rgba(146, 146, 146, 0.25);
background: linear-gradient(90deg, #fff, #fff);
border: 0;
&::after {
display: none;
}
}