绿满眶商城微信小程序-uniapp
peng
2025-06-27 4c3dbf9c9d6e4c657d059c64803ad0e752753576
uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue
@@ -1,7 +1,7 @@
<template>
   <view v-if="visibleSync" :class="{ 'uni-drawer--visible': showDrawer }" class="uni-drawer" @touchmove.stop.prevent="clear">
      <view class="uni-drawer__mask" :class="{ 'uni-drawer__mask--visible': showDrawer && mask }" @tap="close('mask')" />
      <view class="uni-drawer__content" :class="{'uni-drawer--right': rightMode,'uni-drawer--left': !rightMode, 'uni-drawer__content--visible': showDrawer,'custom-style':cusStyle}" :style="{width:drawerWidth+'px',maxHeight:drawerHeight}">
      <view class="uni-drawer__content" :class="{'uni-drawer--right': rightMode,'uni-drawer--left': !rightMode, 'uni-drawer__content--visible': showDrawer,'custom-style':cusStyle}" :style="{width:drawerWidth+'px',maxHeight:drawerHeight,top:drawerTop+'rpx'}">
         <slot />
      </view>
      <!-- #ifdef H5 -->
@@ -76,6 +76,10 @@
         cusStyle: {
            type: Boolean,
            default: false
         },
         drawerTop:{
            type: Number,
            default: 0
         }
      },
      data() {
@@ -86,12 +90,14 @@
            watchTimer: null,
            drawerWidth: 220,
            drawerHeight: null,
            drawerTop:0
         }
      },
      created() {
         // #ifndef APP-NVUE
         this.drawerWidth = this.width
         this.drawerHeight = this.height
         this.drawerTop = this.drawerTop
         console.log("执行了",this.drawerHeight,this.height)
         // #endif
         this.rightMode = this.mode === 'right'
@@ -154,7 +160,6 @@
   }
   .custom-style{
      border-radius: 0 24rpx 24rpx 0;
      top: 100px;
   }
   .uni-drawer--left {