未验证 提交 ca5c0da3 编写于 作者: O openharmony_ci 提交者: Gitee

!15521 plugin使用方法补充

Merge pull request !15521 from wangchensu/0130
......@@ -55,8 +55,8 @@ Plugin组件模板参数。
| --------- | ----------------------------------- | ---- | -------------------------------------------------------------- |
| want | [Want](js-apis-application-want.md) | 是 | 组件使用者Ability信息。 |
| name | string | 是 | 组件名称。 |
| data | [KVObject](#kvobject) | | 组件数据值。 |
| extraData | [KVObject](#kvobject) | | 附加数据值。 |
| data | [KVObject](#kvobject) | | 组件数据值。 |
| extraData | [KVObject](#kvobject) | | 附加数据值。 |
| jsonPath | string | 否 | 存放模板路径的[external.json](#externaljson文件说明)件的路径。 |
### PushParameterForStage
......@@ -74,8 +74,8 @@ Plugin组件模板参数。
| owner | [Want](js-apis-application-want.md) | 是 | 组件提供方Ability信息。 |
| target | [Want](js-apis-application-want.md) | 是 | 组件使用者Ability信息。 |
| name | string | 是 | 组件名称。 |
| data | [KVObject](#kvobject) | | 组件数据值。 |
| extraData | [KVObject](#kvobject) | | 附加数据值。 |
| data | [KVObject](#kvobject) | | 组件数据值。 |
| extraData | [KVObject](#kvobject) | | 附加数据值。 |
| jsonPath | string | 否 | 存放模板路径的[external.json](#externaljson文件说明)文件的路径。 |
### RequestParameters
......@@ -118,8 +118,8 @@ PluginManager.Request方法时候接收到的回调结果。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
| 名称 | 类型 | 必填 | 说明 |
| ----------------- | ---------------------------------------------------- | ---- | ---------- |
| componentTemplate | [PluginComponentTemplate](#plugincomponenttemplate)] | 是 | 组件模板。 |
| ----------------- | --------------------------------------------------- | ---- | ---------- |
| componentTemplate | [PluginComponentTemplate](#plugincomponenttemplate) | 是 | 组件模板。 |
| data | [KVObject](#kvobject) | 是 | 组件数据。 |
| extraData | [KVObject](#kvobject) | 是 | 附加数据。 |
......@@ -175,7 +175,7 @@ OnRequestEventCallback = (source: Want, name: string, data: KVObject) => Request
| 参数 | 类型 | 必填 | 说明 |
| --------- | ----------------------------------- | ---- | --------------------------- |
| source | [Want](js-apis-application-want.md) | 是 | request请求发送方相关信息。 |
| data | [KVObject](#kvobject) | 是 | 数据。 |
| name | string | 是 | 模板名称。 |
| extraData | [KVObject](#kvobject) | 是 | 附加数据。 |
**示例:**
......
......@@ -30,10 +30,21 @@ PluginComponent(value: { template: PluginComponentTemplate, data: KVObject})
| ---------- | ------ | --------------------------- |
| source | string | 组件模板名。 |
| bundleName | string | 提供者Ability的bundleName。 |
## 属性
支持[通用属性size](ts-universal-attributes-size.md),且必须设置size。
**说明:**
模板支持两种提供方式:
* 1.使用绝对路径进行资源提供:source字段填写模板绝对路径,bundleName不需要填写。仅适用于不需要加载资源的单独模板页面,不建议使用。
* 2.通过应用包进行资源提供:bundleName字段需要填写应用包名;source字段填写相对hap包的模板相对路径,对于多hap场景,通过相对路径&hap名称的方式进行hap包的确认。
例如:{source:'ets/pages/plugin.js&plugin', bundleName:'com.example.provider'}
仅对FA模型支持source字段填写AbilityName进行模板提供。
例如:{source:'plugin', bundleName:'com.example.provider'}
除支持[通用属性size](ts-universal-attributes-size.md),且必须设置size。
## 事件
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册