已上传重现代码
- 发布:2021-11-03 11:07
- 更新:2023-07-26 14:40
- 阅读:817
产品分类: uniapp/小程序/阿里
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: Windows10 20H2
HBuilderX类型: Alpha
HBuilderX版本号: 3.2.12
第三方开发者工具版本号: 2.1.9
基础库版本号: 1.25.2
项目创建方式: HBuilderX
操作步骤:
预期结果:
可以正常的编译与替换
可以正常的编译与替换
实际结果:
小程序报错。
小程序报错。
bug描述:
动态拼接了slot插槽,参考社区中的写法,对于小程序采用了HACK的方案,通过了HBuild的编译,但是在小程序那边查看效果时,出现了报错。怀疑是编译的问题,多拼接了大括号。
<template>
<view>
<template v-for="(item, index) in list">
<slot name="st-{{item}}">
{{item}}-{{index}}
</slot>
</template>
</view>
</template>
这个是编译出来的结果
<view><block a:for="{{list}}" a:for-item="item" a:for-index="index"><block a:if="{{$slots.st-{{item}}}}"><slot name="st-{{item}}"></slot></block><block a:else>{{''+item+"-"+index+''}}</block></block></view>
橘子ist (作者)
好的,谢谢。
2021-11-08 15:06