5***@qq.com
5***@qq.com
  • 发布:2025-04-29 10:59
  • 更新:2025-04-29 11:21
  • 阅读:41

【报Bug】微信小程序新增了editor-portal组件,使用uniapp编译后传至key丢失

分类:uni-app

产品分类: uniapp/小程序/微信

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 15.3.1 (24D70)

HBuilderX类型: 正式

HBuilderX版本号: 4.57

第三方开发者工具版本号: Stable 1.06.2412050

基础库版本号: 3.8.0

项目创建方式: HBuilderX

示例代码:

uniapp中代码

<block v-for="(item,idx) in customBlockList" :key="idx">  
                <editor-portal :key="item.blockId">  
                    <view class="flex">  
                        <view>{{item.blockId}}</view>  
                        <view>{{item.text}}</view>  
                    </view>   
                </editor-portal>  
            </block>

编译小程序后的代码

<block><editor-portal vue-id="{{'019b57bf-'+idx}}" bind:__l="__l" vue-slots="{{['default']}}"><view class="flex"><view>{{item.blockId}}</view><view>{{item.text}}</view></view></editor-portal></block>

操作步骤:

uniapp中代码

<block v-for="(item,idx) in customBlockList" :key="idx">  
                <editor-portal :key="item.blockId">  
                    <view class="flex">  
                        <view>{{item.blockId}}</view>  
                        <view>{{item.text}}</view>  
                    </view>   
                </editor-portal>  
            </block>

编译小程序后的代码

<block><editor-portal vue-id="{{'019b57bf-'+idx}}" bind:__l="__l" vue-slots="{{['default']}}"><view class="flex"><view>{{item.blockId}}</view><view>{{item.text}}</view></view></editor-portal></block>

预期结果:

应该编译小程序后的代码

<editor-portal key="{{item.blockId}}" vue-id="{{'019b57bf-'+idx}}" bind:__l="__l" vue-slots="{{['default']}}"><view class="flex"><view>{{item.blockId}}</view><view>{{item.text}}</view></view></editor-portal>

实际结果:
<editor-portal vue-id="{{'019b57bf-'+idx}}" bind:__l="__l" vue-slots="{{['default']}}"><view class="flex"><view>{{item.blockId}}</view><view>{{item.text}}</view></view></editor-portal>

bug描述:

【报Bug】微信小程序新增了editor-portal组件,使用uniapp编译后传至key丢失

2025-04-29 10:59 负责人:无 分享
已邀请:
DCloud_UNI_JBB

DCloud_UNI_JBB

您好,麻烦提供一个可复现的demo

要回复问题请先登录注册