<view style="position: fixed; top: 0; width: 100%;"> <view class="tab"> <view class="tab-item {{currentTab == 0 ? 'active' : ''}}" bindtap="switchTab" data-index="0" data-value="待领取">待领取 </view> <view class="tab-item {{currentTab == 1 ? 'active' : ''}}" bindtap="switchTab" data-index="1" data-value="进行中">进行中 </view> <view class="tab-item {{currentTab == 2 ? 'active' : ''}}" bindtap="switchTab" data-index="2" data-value="已完成">已完成 </view> <view class="tab-item {{currentTab == 3 ? 'active' : ''}}" bindtap="switchTab" data-index="3" data-value="已逾期">已逾期 </view> <view class="tab-item {{currentTab == 4 ? 'active' : ''}}" bindtap="switchTab" data-index="4" data-value="已驳回">已驳回 </view> </view> </view> <view style="margin-top: 100rpx;"> <view wx:for="{{underway}}" wx:key="code"> <view class="boxcard"> <view class="projectSampleId"> 问卷ID:{{item.projectSampleId}} <text class="labeltext">{{label}}</text> </view> <view class="border-bottom"></view> <view wx:for="{{item.newtags}}" wx:if="{{item.tags != null}}" class="tags" wx:key="index" wx:for-item="newitem"> {{newitem}} </view> <view class="content"> <view>开始时间:{{item.startDate}}</view> <view>结束时间:{{item.endDate}}</view> <view>所属项目:{{item.projectName}}</view> <view>任务ID:{{item.customerTaskId}}</view> </view> <view class="bottombutton"> <button size="mini" class="rectifyFeedback" wx:if="{{currentTab==1||currentTab==3}}" bindtap="rectifyFeedback" data-customer-task-id="{{ item.customerTaskId }}">整改反馈</button> <button size="mini" class="reviewFeedback" bindtap="reviewFeedback" data-customer-task-id="{{item.customerTaskId}}" wx:if="{{currentTab==2}}">查看反馈</button> <button size="mini" class="receiveTask" wx:if="{{currentTab==0}}" bindtap="receiveTask" data-customer-task-id="{{ item.customerTaskId }}"> 领取任务</button> <button size="mini" class="taskSamples" bindtap="taskSamples" data-project-Sample-Id="{{item.projectSampleId}}">任务样本 </button> <button size="mini" class="overruleTask" wx:if="{{currentTab==0||currentTab==1||currentTab==3}}" bindtap="overruleTask" data-customer-task-id="{{ item.customerTaskId }}">驳回任务</button> <button size="mini" class="overruleApplication" bindtap="overruleApplication" data-customer-task-id="{{item.customerTaskId}}" wx:if="{{currentTab==4}}">驳回详情</button> </view> </view> </view> </view> 这是我的wxml代码。请问我的按钮在上划时。会遮挡tab怎么解决
时间: 2023-07-02 11:07:48 浏览: 22
可以尝试在tab元素的样式中添加 `z-index: 1;`,使其在层级上高于按钮,避免被遮挡。例如:
```
.tab {
position: fixed;
top: 0;
width: 100%;
z-index: 1;
}
```
同时,你可以将按钮的样式中的 `position` 属性设置为 `relative`,然后调整其 `z-index` 属性,使其处于tab下方。例如:
```
.bottombutton button {
position: relative;
z-index: -1;
}
```
这样就可以避免按钮遮挡tab的问题了。