-
index.vue
<template> <view> <mm-list> <template #str> <mm-str str="正常显示"></mm-str> </template> </mm-list> <mm-list> <template #str="{str}"> <mm-str str="微信小程序无法显示"></mm-str> </template> </mm-list> <mm-list> <template #str="{str}"> <!-- 小程序无法显示 --> <mm-str :str="str"></mm-str> </template> </mm-list> </view> </template>
-
mm-list.vue
<template> <view> <slot name="str" :str="'123'"></slot> </view> </template>
-
mm-str.vue
<template> <view> {{str}} </view> </template> <script> export default { props: ['str'] } </script>
- 发布:2020-08-06 14:30
- 更新:2020-09-27 16:58
- 阅读:972
产品分类: uniapp/小程序/微信
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 2.8.3
第三方开发者工具版本号: 1.03.2006090
基础库版本号: 2.12.0
项目创建方式: HBuilderX
示例代码:
操作步骤:
mm-list.vue 和 mm-str.vue 组件按照easycom规则放入项目中,运行index.vue
mm-list.vue 和 mm-str.vue 组件按照easycom规则放入项目中,运行index.vue
预期结果:
微信小程序的easycom希望能生效
微信小程序的easycom希望能生效
实际结果:
app显示正常,微信小程序easycom失效
app显示正常,微信小程序easycom失效
bug描述:
当一个组件的作用域插槽具有prop时,且被暴露在父组件中,此时插槽中插入另一个组件,这时在微信小程序下easycom失效,必须使用引入注册组件的方式才能渲染。
DCloud_UNI_GSQ
看看看
2020-08-18 11:22