提交 35b5fb52 编写于 作者: 雪洛's avatar 雪洛

Update mp-weixin-plugin.md

上级 cc56ee11
......@@ -45,7 +45,7 @@
#### 在页面中使用
在页面内使用插件需要在`pages.json`内对应页面的`style`节点下配置,示例如下。
在页面内使用插件需要在`pages.json`内对应页面的`style`节点下配置对应平台的`usingComponents`,示例如下。
`"hello-component": "plugin://myPlugin/hello-component"`为例,`key`(冒号前的`hello-component`)为在页面内使用的组件名称。`value`分为三段,`plugin`为协议(在百度小程序内为`dynamicLib`),`myPlugin`为插件名称即引入插件时的名称,`hello-component`为插件暴露的组件名称。
......@@ -54,8 +54,10 @@
{
"path": "pages/index/index",
"style": {
"usingComponents": {
"hello-component": "plugin://myPlugin/hello-component"
"mp-weixin": {
"usingComponents": {
"hello-component": "plugin://myPlugin/hello-component"
}
}
}
}
......@@ -64,8 +66,10 @@
{
"path": "pages/index/index",
"style": {
"usingComponents": {
"hello-component": "plugin://myPlugin/hello-component"
"mp-alipay": {
"usingComponents": {
"hello-component": "plugin://myPlugin/hello-component"
}
}
}
}
......@@ -74,8 +78,10 @@
{
"path": "pages/index/index",
"style": {
"usingComponents": {
"my-special-list": "dynamicLib://myDynamicLib/special-list"
"mp-baidu": {
"usingComponents": {
"my-special-list": "dynamicLib://myDynamicLib/special-list"
}
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册