You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ky...@apache.org on 2019/08/08 09:17:02 UTC

[incubator-weex-site] branch master updated: Update doc for richtext. (#476)

This is an automated email from the ASF dual-hosted git repository.

kyork pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex-site.git


The following commit(s) were added to refs/heads/master by this push:
     new 8275186  Update doc for richtext. (#476)
8275186 is described below

commit 8275186dba3bcdcd422ffb6e1c5f68745fa20c96
Author: YorkShen <sh...@gmail.com>
AuthorDate: Thu Aug 8 17:16:56 2019 +0800

    Update doc for richtext. (#476)
---
 docs/docs/components/richtext.md    | 11 ++++++-----
 docs/zh/docs/components/richtext.md | 13 +++++++------
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/docs/docs/components/richtext.md b/docs/docs/components/richtext.md
index 704fc4e..f702fd4 100644
--- a/docs/docs/components/richtext.md
+++ b/docs/docs/components/richtext.md
@@ -31,6 +31,7 @@ Supported attributes of children of a `richtext`.
 #### a
 
 * **herf**. The herf.
+* **pseudo-ref**. A ref assigned by developers and passed to the callback function of **itemclick**.
 
 #### span
 
@@ -64,16 +65,16 @@ Only limited css styles listed below are supported by richtext.
 ## Events
 
 * **common events**. Support [common events](../events/common-events.html).
-* **itemclick**. Only works on `img` and `span`:
+* **itemclick**. Only works on `img` and `a`:
    * `img` tag:
       * None of parents is an `a` tag when the `img` tag is clicked.
       * If the first condition is not satisfied, Weex will try to open the hyperlink of `a` tag instead.
       * **pseudo-ref** of img will be passed to the callback function of onitemclick.
-   * `span` tag:
-      * The `span` tag is clicked whose parent is an `a` tag.
+   * `a` tag:
       * The href property is 'click://' (This condition is required on iOS and is optional on Android).
-      * The `a` tag has a `pseudo-ref` property whose value will be sent with the itemclick event.
+      * The `a` tag has a `pseudo-ref` property whose value will be sent with the itemclick event. **Please be noted that the default jump behavior on `a` tag will be disabled at this moment.`[Demo](http://editor.weex.io/p/sunshl/Contribute/commit/b21e1133830b48767c6d00d712e415b2)
+    * If `itemclick` is specified on nested nodes, only the event on the outer node will take effect.
 
 ## Example
 
-[Demo](http://dotwe.org/vue/f748b0cee3991522a66d4376b66a4f2a)
+[Demo](http://dotwe.org/vue/8a817e1acb46c2910caf1b53b8016a48)
diff --git a/docs/zh/docs/components/richtext.md b/docs/zh/docs/components/richtext.md
index 1092a57..14e8a39 100644
--- a/docs/zh/docs/components/richtext.md
+++ b/docs/zh/docs/components/richtext.md
@@ -30,6 +30,7 @@
 #### a
 
 * **herf**. Herf。
+* **pseudo-ref**. 开发者指定的索引,会被传给回调方法 **itemclick**。
 
 #### span
 
@@ -63,16 +64,16 @@
 ## 事件
 
 * **通用事件** 支持所有[通用事件](../events/common-events.html)。
-* **itemclick**. 只有`img`和`span`标签可能触发,触发时机是: 
+* **itemclick**. 只有`img`和`a`标签可能触发,触发时机是: 
    * `img`标签:
       * `img`被点击时没有任何父节点是 `a`
       * 如果第一个条件不满足,Weex 会尝试打开 `a` 标签指定的链接。
       * `img` 的 **pseudo-ref** 会作为参数传回来。
-   * `span`标签:
-      * `a`标签中的`span`被点击
-      * 并且所在的`a`标签的href被指定为"click://"(这个条件iOS端强要求,Android端并不要求)
-      * a标签设置了pseudo-ref。此时itemclick事件会被触发,并且携带pseudo-ref的值。[示例](http://editor.weex.io/p/sunshl/Contribute/commit/b21e1133830b48767c6d00d712e415b2)
+   * `a`标签:
+      * `a`标签的href被指定为"click://"(这个条件iOS端强要求,Android端并不要求)
+      * `a`标签设置了pseudo-ref。此时itemclick事件会被触发,并且携带pseudo-ref的值。**此时 `a` 标签的无效。**。[示例](http://editor.weex.io/p/sunshl/Contribute/commit/b21e1133830b48767c6d00d712e415b2)
+    * 若多个嵌套节点上均包含 `itemclick` 事件,则只有最外层节点上的 `itemclick` 会被触发
 
 ## 示例
 
-[示例](http://dotwe.org/vue/f748b0cee3991522a66d4376b66a4f2a)
+[示例](http://dotwe.org/vue/8a817e1acb46c2910caf1b53b8016a48)