d***@gaojiua.com
d***@gaojiua.com
  • 发布:2024-03-08 13:26
  • 更新:2024-03-08 17:35
  • 阅读:169

【报Bug】$slots.xxx 在 app vue 下不生效,nvue/h5 下测试通过

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 14.3.1 (23D60)

HBuilderX类型: 正式

HBuilderX版本号: 3.99

手机系统: 全部

手机厂商: 华为

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

测试过的手机:

各种手机都无法实现

示例代码:
<template>  
  <view class="content">  
    <image class="logo" src="/static/logo.png"></image>  
    <view class="">  
      <slot-bug>  
        <template #right>  
          <view>xxx</view>  
        </template>  
      </slot-bug>  
    </view>  
  </view>  
</template>
<template>  
  <view>  
    <text>slot-bug</text>  
    <view class="">  
      <slot name="right"></slot>  
    </view>  
    <view class="">  
      {{ Boolean($slots.right) }}  
    </view>  
  </view>  
</template>  
<script>  
export default {  
  name: "solt-bug",  
  created() {  
    console.log(Object.keys(this.$slots));  
  },  
}  
</script>  
<style>  
</style>

操作步骤:

运行 APP 即可见

预期结果:

预期:Boolean($slots.right) is true

实际结果:

实际:Boolean($slots.right) is false

bug描述:

$slots.xxx 在 app vue 下不生效,slots.xxx 如果获取到相应的 slot

2024-03-08 13:26 负责人:YUANRJ 分享
已邀请:
YUANRJ

YUANRJ

感谢反馈,这边排查下

YUANRJ

YUANRJ

已复现问题,后续会修复,可以先使用$scopedSlots

要回复问题请先登录注册