uni-app icon indicating copy to clipboard operation
uni-app copied to clipboard

skyline模式下无法获取list-builder组件的slot数据

Open MinakoKitani opened this issue 1 year ago • 1 comments
trafficstars

微信小程序启用了skyline渲染模式,其中使用了scroll-view和list-builder组件。 微信小程序官方文档中使用的时候可以通过插槽来指明传入的数据 但是在uniapp不懂怎么使用,按照示例文档用会被过滤掉,没有编译出来

<scroll-view
      class="flex w-full pl-48rpx pr-8rpx flex-1"
      type="custom"
      :scrollY="true"
      :scrollTop="scrollTop"
      :refresherEnabled="true"
      :refresherTriggered="refresherTriggered"
      :showScrollbar="true"
      :enableFlex="true"
      @refresherrefresh="onRefresh"
    >
      <list-builder
        type="dynamic"
        :list="convertList"
        :childCount="convertList.length"
      >
          <view slot:name slot:index>
            {{ item }}
          </view>
          <Paragraph
            :paragraph="item"
            :speakers="speakerInfo"
            :speakerColor="speakerColor"
            :picList="picRenderMap[item.id] || []"
          />
      </list-builder>
    </scroll-view>

编译后结果

<scroll-view
      class="flex w-full pl-48rpx pr-8rpx flex-1"
      type="custom"
      scrollY="{{true}}"
      scrollTop="{{g}}"
      refresherEnabled="{{true}}"
      refresherTriggered="{{h}}"
      showScrollbar="{{true}}"
      enableFlex="{{true}}"
      bindrefresherrefresh="{{i}}"
      ><list-builder type="dynamic" list="{{e}}" childCount="{{f}}"
        ><view slot:name slot:index>{{ c }}</view
        ><paragraph wx:if="{{d}}" u-i="a5d43c0c-1" bind:__l="__l" u-p="{{d}}" /></list-builder
    ></scroll-view>

其中view标签及paragraph 组件都是无法获取到list-builder传递的item及index 猜测是写法错误了,期望有大佬可以帮忙解答下!

MinakoKitani avatar Aug 21 '24 10:08 MinakoKitani

我尝试过将list-builder 使用wxcomponents 自定义重新实现,插槽也是无法获取到数据,我只是单个页面开启skyline渲染模式,不知道是不是没有全局开启skyline渲染导致的问题。

Image

waterbang avatar May 13 '25 08:05 waterbang