幽灵陆战队
幽灵陆战队
  • 发布:2025-06-19 18:07
  • 更新:2025-06-19 18:07
  • 阅读:10

【报Bug】position: absolute 在nvue中的布局样式错误,没有按照父视图的尺寸展示

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: MacOS15.5

HBuilderX类型: 正式

HBuilderX版本号: 4.66

手机系统: iOS

手机系统版本号: iOS 18

手机厂商: 苹果

手机机型: iPhone12

页面类型: nvue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

示例代码:
 <cover-view class="callout-footprint-container">  
        <cover-image  
          class="callout-bubble"  
          style="background-color: red"  
          src="/static/images/home/callout/bubble.png"  
          mode="scaleToFill"  
        />  
</cover-view>

// 显示正常的样式,必须设置cover-image的宽高

.callout-footprint-container {  
  margin-bottom: 93rpx;  
  width: 356rpx;  
  height: 124rpx;  
  z-index: 9990;  
  position: relative;  

  .callout-bubble {  
    position: absolute;  
    top: 10rpx;  
    left: 0;  
    width: 356rpx;  
    height: 114rpx;  
  }  
}

// 显示错误的样式

.callout-footprint-container {  
  margin-bottom: 93rpx;  
  width: 356rpx;  
  height: 124rpx;  
  z-index: 9990;  
  position: relative;  

  .callout-bubble {  
    position: absolute;  
    top: 10rpx;  
    right: 0;  
    bottom: 0;  
    left: 0;  
  }  
}

操作步骤:

运行就复现

预期结果:

正常显示图片

实际结果:

图片尺寸显示错误

bug描述:

cover-image在nvue中使用,运行后布局样式错误。
布局代码:

.callout-bubble {  
    position: absolute;  
    top: 10rpx;  
    right: 0;  
    bottom: 0;  
    left: 0;  
  }

显示结果cover-image并没有按照父视图的尺寸进行显示,而是超出了父视图

2025-06-19 18:07 负责人:无 分享
已邀请:

要回复问题请先登录注册