You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ha...@apache.org on 2018/04/18 03:53:36 UTC

[2/5] incubator-weex-site git commit: update the Chinese document of the weex api

update the Chinese document of the weex api

Project: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/commit/0eb2de4a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/tree/0eb2de4a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/diff/0eb2de4a

Branch: refs/heads/master
Commit: 0eb2de4a11ad49856c6e7716b14ac8b2903f7f18
Parents: 2ef7e59
Author: Hanks <zh...@gmail.com>
Authored: Tue Apr 17 14:56:04 2018 +0800
Committer: GitHub <no...@github.com>
Committed: Tue Apr 17 14:56:04 2018 +0800

----------------------------------------------------------------------
 source/cn/references/weex-variable.md | 33 ++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/0eb2de4a/source/cn/references/weex-variable.md
----------------------------------------------------------------------
diff --git a/source/cn/references/weex-variable.md b/source/cn/references/weex-variable.md
index 198279e..f2da5cd 100644
--- a/source/cn/references/weex-variable.md
+++ b/source/cn/references/weex-variable.md
@@ -160,3 +160,36 @@ weex.supports('module/*') // null
 weex.supports('@stream/fetch') // null
 weex.supports('getComponentRect') // null
 ```
+
+## `weex.isRegisteredModule`
+
+检测某个特定的模块或者接口是否可用。
+
+```js
+weex.weex.isRegisteredModule(moduleName: string, methodName: string): boolean
+```
+
+这个接口只能用于检测特定模块和方法的兼容性,不支持检测组件。
+
+```js
+weex.isRegisteredModule('stream') // true
+weex.isRegisteredModule('stream', 'fetch') // true
+weex.isRegisteredModule('whatever', '- unknown -') // false
+weex.isRegisteredModule('div') // false, not support components
+```
+
+## `weex.isRegisteredComponent`
+
+检测某个特定的组件是否可用。
+
+```js
+weex.weex.isRegisteredComponent(componentName: string): boolean
+```
+
+这个接口只能用于检测组件的兼容性,不支持检测模块。
+
+```js
+weex.isRegisteredComponent('div') // true
+weex.isRegisteredComponent('- unknown -') // false
+weex.isRegisteredComponent('navigator') // false, not support modules
+```