m***@163.com
m***@163.com
  • 发布:2025-04-09 12:46
  • 更新:2025-04-10 11:35
  • 阅读:55

【报Bug】uniapp skyline模式下,平台对应的组件无法正常使用,如list-builder 、grid-builder

分类:uni-app

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

PC开发环境操作系统: Windows

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

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

基础库版本号: 3.7.12

项目创建方式: CLI

CLI版本号: 3.0.0-4050720250324001

示例代码:
    <!-- #ifdef MP-WEIXIN -->  
    <scroll-view class="scroll-view h-full w-full" scroll-y type="custom">  
      <grid-builder  
        :list="viewedCircles"  
        :child-count="viewedCircles.length"  
        :cross-axis-count="2"  
        :cross-axis-gap="8"  
        :main-axis-gap="4"  
      >  
        <view slot:item slot:index class="bg-blue" style="height: 200px">  
            <view>{{ item }}-{{ index }}</view>  
        </view>  
      </grid-builder>  
    </scroll-view>  
    <!-- #endif -->
viewedCircles.value = [  
    {  
      id: 1,  
      logo: 'https://picsum.photos/200/200',  
      name: '摄影爱好者',  
      heat: 1234,  
    },  
    {  
      id: 2,  
      logo: 'https://picsum.photos/200/200',  
      name: '美食分享',  
      heat: 2345,  
    },  
    {  
      id: 3,  
      logo: 'https://picsum.photos/200/200',  
      name: '旅行探索',  
      heat: 3456,  
    },  
    {  
      id: 4,  
      logo: 'https://picsum.photos/200/200',  
      name: '科技资讯',  
      heat: 4567,  
    },  
    {  
      id: 5,  
      logo: 'https://picsum.photos/200/200',  
      name: '读书会',  
      heat: 5678,  
    },  
  ];

操作步骤:

如图所示

预期结果:

如图所示

实际结果:

如图所示

bug描述:

求助使用uniapp中怎么避免编译某一段代码?因为要使用该平台的特定组件,但是这个组件插槽传值用vue又没法写出来

如下图所示,

尝试1:
使用

     <view slot:item slot:index class="bg-blue" style="height: 200px">  
            <view>{{ item }}-{{ index }}</view>  
        </view>

其中 item 和 index 都会被转编译,从而找不到值,

尝试2:
使用

<template #item="{ item, index }">  
      <view>{{ item }}-{{ index }}</view>  
</template>

会提示没有item插槽

2025-04-09 12:46 负责人:无 分享
已邀请:
m***@163.com

m***@163.com (作者)

组件地址:https://developers.weixin.qq.com/miniprogram/dev/component/grid-builder.html

m***@163.com

m***@163.com (作者)

看到官方文档上显示支持这个组件啊,但没有提供示例,有大佬能帮忙给个思路吗

m***@163.com

m***@163.com (作者)

@DCloud_HB_DYF @DCloud_CHB @DCloud移动团队

要回复问题请先登录注册