itmonkey
itmonkey
  • 发布:2022-03-12 11:28
  • 更新:2023-02-27 16:31
  • 阅读:437

【报Bug】vue3 小程序端 插槽内容不显示

分类:uni-app

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

PC开发环境操作系统: Windows

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

HBuilderX类型: 正式

HBuilderX版本号: 3.3.11

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

基础库版本号: 2.221

项目创建方式: HBuilderX

示例代码:

代码格式类似如下,在一个组建中

<view v-if="props.elData.style ===1 && goodsList.length" class="goods-lg-box">  
            <view class="ss-m-b-20" v-for="item in goodsList" :key="item.id">  
                <ui-goods-card class="goods-card" size="lg" :includes="goodsFields" :title="item.title"  
                    :subTitle="item.subtitle" :img="item.image" :price="item.price" :originPrice="item.original_price"  
                    :titleColor="goodsFieldsStyle.title?.color" :subTitleColor="goodsFieldsStyle.subtitle.color"  
                    :sales="item.sales" @click="sheep.$router.go('/pages/goods/detail/index')">  
                    <template #cart>  
                        <button class="ss-reset-button cart-btn"  
                            :style="[buyStyle]">{{buyData.style ===1 ? buyData.text  : '' }}</button>  
                    </template>  
                </ui-goods-card>  
            </view>  

        </view>

操作步骤:

插槽部分,使用 template + # || v-slot 语法无法显示插槽内容
使用view + slot 可以显示插槽内容

预期结果:

使用vue3 template + # || v-slot 语法小程序端,可以正常显示内容

实际结果:

开发者工具上,无法显示插槽内容

bug描述:

在一个组件中,v-if 的情况下,循环了一个商品卡片,里面有个具名插槽,小程序端不显示内容,
H5端正常

2022-03-12 11:28 负责人:无 分享
已邀请:
小枫叶

小枫叶 - 外包接单加v:wlmk1234567 注明来意

这是具名插槽?

小枫叶

小枫叶 - 外包接单加v:wlmk1234567 注明来意

语法糖好像不支持的

u***@126.com

u***@126.com

你的问题解决了吗?我现在好像也用不了

要回复问题请先登录注册