首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >自定义插件bug?

自定义插件bug?

提问于 2018-03-16 00:59:08
回答 1关注 0查看 302

小程序自定义插件组成结构如下

暴露的public-components中有一个组件,例如 ComA

comA中使用了另两个组件,comB和comC

在小程序中引入插件使用comA

发现comA中的comB和comC的样式丢失

如果插件中直接暴露comB或者comC

在小程序中引入插件使用comB或者comC

comB的样式正常

预期无论comA还是comB或者comC都应该样式正常

======================== 插件部分 ========================

plugin.json

{  "publicComponents": {    "list": "components/list/list"   },  "main": "index.js"}

组件 list.wxml

<view>  <item /></view>

组件list.json

{  "component": true,  "usingComponents": {    "item": "./item"  }}

组件 Item.wxml

<!--plugin/components/list/item.wxml--><text class="haha">plugin/components/list/item.wxml</text>

组件 item.wxss

/* plugin/components/list/item.wxss */ .haha {  background-color: red;  color: #fff;}

======================== 使用插件的小程序部分 ========================

小程序 app.js

{  "pages": [    "pages/index/index"  ],  "plugins": {    "myPlugin": {      "version": "dev",      "provider": "touristappid"    }  }}

小程序 index.wxml

<!-- <checkin-picker /> --> <list />

小程序 Index.json

{  "usingComponents": {    "list": "plugin://myPlugin/list",  }}

小程序输入结果

可以看到 item组件中的文字颜色和背景全部丢失

==========================

如果我修改 插件的Plugin.json为

{  "publicComponents": {    "list": "components/list/item",    },  "main": "index.js"}

也就是直接暴露 Item这个组件,预览一下

可以看到item的背景颜色和文字颜色样式正常。。

这不是bug么?

=================

以上都是在新建插件项目模板的基础上改的,而且即使是插件模板项目,console中也一直报这些错误

不知道什么原因

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档