易生
易生
  • 发布:2022-11-11 09:42
  • 更新:2022-11-11 20:04
  • 阅读:300

【报Bug】循环内的解构插槽无法在微信小程序中使用

分类:uni-app

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

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 22000.1219

HBuilderX类型: 正式

HBuilderX版本号: 3.6.4

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

基础库版本号: 3.6.4.20220922

项目创建方式: HBuilderX

示例代码:

组件

<view v-for="rIndex in rowCount" :key="rIndex">  
    <u-row>  
        <u-col :span="12 / cols" v-for="index in columnCount" :key="index">  
        <slot v-if="dataList[cardIndex(rIndex,index)]" :data="dataList[cardIndex(rIndex,index)]" :index="cardIndex(rIndex,index)"></slot>  
    </u-col>  
    </u-row>  
</view>

页面:

<template v-slot="{data,index}">  
    <view>  
            {{data + ' ' + index}}  
    </view>  
</template>  

操作步骤:

运行示例代码

预期结果:

正常显示

实际结果:

(1)微信开发者工具控制台报错:Property or method "index" is not defined on the instance but referenced during render.
(2)小程序页面只有第一行有显示,其余行不显示,

bug描述:

【微信小程序】循环内使用解构插槽在APP和H5端正常,微信小程序出错

2022-11-11 09:42 负责人:无 分享
已邀请:
DCloud_UNI_WZF

DCloud_UNI_WZF

  1. 微信小程序不支持多个同名插槽
  2. 微信小程序暂不支持动态作用域插槽

该问题目前已经被锁定, 无法添加新回复