希望可以帮到有需要的小伙伴们,效果图:
代码
html
<!-- 抽屉 begin -->
<view class="drawer">
<view class="background" v-if="open" @touchmove.stop>
<view class="left" @click.self="closeDrawer"></view>
<view class="drop" :class="{ active: isActive, close: isClose }">
<view class="logout"><text>退出</text></view>
</view>
</view>
</view>
<!-- 抽屉 end -->
css
.background {
z-index: 1;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba($color: #000000, $alpha: 0.5);
display: flex;
.left {
flex: 1;
}
.drop {
width: 0px;