From 2d648682015e9c5cd91616f17a8c85c9817acdbe Mon Sep 17 00:00:00 2001 From: shutao Date: Fri, 11 Oct 2024 15:29:25 +0800 Subject: [PATCH] update native-view.md --- docs/component/native-view.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/component/native-view.md b/docs/component/native-view.md index 917b66b5..e14867fc 100644 --- a/docs/component/native-view.md +++ b/docs/component/native-view.md @@ -13,19 +13,27 @@ ### 使用场景 -`native-view` 适用于开发[标准模式的uts组件](../plugin/uts-vue-component.md) +`native-view` 适用于开发[uts插件-标准模式组件](../plugin/uts-vue-component.md) ### 使用教程 -+ 获取 UniNativeViewElement +#### 获取 UniNativeViewElement `native-view`提供 @init 监听元素初始化,通过事件[UniNativeViewInitEvent](#uninativeviewinitevent)的 detail.element 获取到 [UniNativeViewElement](../dom/uninativeviewelement.md)。 -+ 绑定原生view +#### UniNativeViewElement绑定原生view + +**Android 平台:** -[UniNativeViewElement](../dom/uninativeviewelement.md) 提供了[bindAndroidView](../dom/uninativeviewelement.md#bindandroidview)与`native-view`绑定安卓原生view, [bindIOSView](../dom/uninativeviewelement.md#bindiosview)与`native-view`绑定IOS原生view, 绑定后view则自动适配[组件全局属性](common.md#组件全局属性)。 +[UniNativeViewElement](../dom/uninativeviewelement.md) 提供[bindAndroidView](../dom/uninativeviewelement.md#bindandroidview)函数与`native-view`绑定android平台原生view + +**IOS 平台:** + +[UniNativeViewElement](../dom/uninativeviewelement.md) 提供[bindIOSView](../dom/uninativeviewelement.md#bindiosview)函数与`native-view`绑定ios平台原生view + +绑定后view则自动适配[组件全局属性](common.md#组件全局属性)。 -+ 分发自定义事件 +#### 分发自定义事件 [UniNativeViewElement](../dom/uninativeviewelement.md) 提供了dispatchEvent分发event事件API,注意:事件数据类型暂时只支持[UniNativeViewEvent](#uninativeviewevent)。 -- GitLab