You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/06/02 06:03:43 UTC

[03/46] incubator-weex git commit: * [doc] update changes doc since 0.10

* [doc] update changes doc since 0.10


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

Branch: refs/heads/master
Commit: f4a57cc5a2efe3c259607d929c546b936c909682
Parents: 5c72f20
Author: moxun.ljf <fu...@foxmail.com>
Authored: Wed Mar 29 11:46:51 2017 +0800
Committer: moxun.ljf <fu...@foxmail.com>
Committed: Wed Mar 29 11:46:51 2017 +0800

----------------------------------------------------------------------
 doc/source/cn/references/components/list.md     | 13 +++++++++++++
 doc/source/cn/references/components/scroller.md | 16 +++++++++++++++-
 doc/source/cn/references/components/slider.md   |  8 ++++++++
 doc/source/cn/references/modules/dom.md         |  1 +
 4 files changed, 37 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4a57cc5/doc/source/cn/references/components/list.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/references/components/list.md b/doc/source/cn/references/components/list.md
index 4055fe3..3cc3049 100644
--- a/doc/source/cn/references/components/list.md
+++ b/doc/source/cn/references/components/list.md
@@ -42,6 +42,7 @@ version: 2.1
 ## 特性
 
 - `loadmoreoffset {number}`:默认值为 0,触发 `loadmore` 事件所需要的垂直偏移距离(设备屏幕底部与 `<list>` 底部之间的距离)。当 `<list>` 的滚动条滚动到足够接近 `<list>` 底部时将会触发 `loadmore` 这个事件。
+- `offset-accuracy {number}` <sup class="wx-v">0.11+</sup>:控制`onscroll`事件触发的频率,默认值为10,表示两次`onscroll`事件之间列表至少滚动了10px。注意,将该值设置为较小的数值会提高滚动事件采样的精度,但同时也会降低页面的性能。
 
 ## 样式
 
@@ -59,6 +60,15 @@ version: 2.1
 
 - `loadmore` <sup class="wx-v">0.5+</sup>:如果列表滚动到底部将会立即触发这个事件,你可以在这个事件的处理函数中加载下一页的列表项。
 - `onscroll` <sup class="wx-v">0.11+</sup>: 列表发生滚动时将会触发该事件,事件的默认抽样率为10px,即列表每滚动10px触发一次,可通过属性`offset-accuracy`设置抽样率。    
+  
+  事件中 event 对象属性:
+  - `contentSize {Object}`:列表的内容尺寸
+    - `width {number}`: 列表内容宽度
+    - `height {number}`: 列表内容高度
+  - `contentOffset {Object}`: 列表的偏移尺寸
+    - `x {number}`: x轴上的偏移量
+    - `y {number}`: y轴上的偏移量
+
 - 通用事件
 
   支持所有通用事件:
@@ -76,6 +86,9 @@ version: 2.1
 
 滚动到列表某个指定项是常见需求,`<list>` 拓展了该功能支持滚动到指定 `<cell>`。通过 `dom` module 访问,更多信息可参考 [dom module](../modules/dom.html) 。
 
+### resetLoadmore() <sup class="wx-v">0.9+</sup>
+在默认情况下,触发`loadmore`事件后,如果列表中内容没有发生变更,则下一次滚动到列表末尾时将不会再次触发`loadmore`事件,你可以通过调用`resetLoadmore()`方法来打破这一限制,调用该方法后,下一次滚动到列表末尾时将强制触发`loadmore`。
+
 #### 参数
 
 - `node {node}`:指定目标节点。

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4a57cc5/doc/source/cn/references/components/scroller.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/references/components/scroller.md b/doc/source/cn/references/components/scroller.md
index 297f712..175b3f7 100644
--- a/doc/source/cn/references/components/scroller.md
+++ b/doc/source/cn/references/components/scroller.md
@@ -41,7 +41,8 @@ version: 2.1
 
   ![mobile_preview](../images/scroller_1.jpg)
 
-- `loadmoreretry {number}`:默认值为 0,当 `loadmore` 失败时是否重置 `loadmore` 相关的 UI,值不一样就会重置。
+- ~~`loadmoreretry {number}`:默认值为 0,当 `loadmore` 失败时是否重置 `loadmore` 相关的 UI,值不一样就会重置。~~ 该属性已废弃,请使用`resetLoadmore()`函数实现重置`loadmore`的操作。
+- `offset-accuracy {number}` <sup class="wx-v">0.11+</sup>:控制`onscroll`事件触发的频率,默认值为10,表示两次`onscroll`事件之间列表至少滚动了10px。注意,将该值设置为较小的数值会提高滚动事件采样的精度,但同时也会降低页面的性能。
 
 ## 样式
 
@@ -58,6 +59,16 @@ version: 2.1
 ## 事件
 
 - `loadmore` <sup class="wx-v">v0.5+</sup>:如果滚动到底部将会立即触发这个事件,你可以在这个事件的处理函数中加载下一页的列表项。
+- `onscroll` <sup class="wx-v">0.11+</sup>: 列表发生滚动时将会触发该事件,事件的默认抽样率为10px,即列表每滚动10px触发一次,可通过属性`offset-accuracy`设置抽样率。    
+
+  事件中 event 对象属性:
+  - `contentSize {Object}`:列表的内容尺寸
+    - `width {number}`: 列表内容宽度
+    - `height {number}`: 列表内容高度
+  - `contentOffset {Object}`: 列表的偏移尺寸
+    - `x {number}`: x轴上的偏移量
+    - `y {number}`: y轴上的偏移量
+
 - 通用事件
 
   支持所有通用事件:
@@ -75,6 +86,9 @@ version: 2.1
 
 滚动到列表某个指定项是常见需求,`<list>` 拓展了该功能支持滚动到指定 `<cell>`。通过 `dom` module 访问,更多信息可参考 [dom module](../modules/dom.html) 。
 
+### resetLoadmore() <sup class="wx-v">0.9+</sup>
+在默认情况下,触发`loadmore`事件后,如果列表中内容没有发生变更,则下一次滚动到列表末尾时将不会再次触发`loadmore`事件,你可以通过调用`resetLoadmore()`方法来打破这一限制,调用该方法后,下一次滚动到列表末尾时将强制触发`loadmore`。
+
 #### 参数
 
 - `node {node}`:指定目标节点。

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4a57cc5/doc/source/cn/references/components/slider.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/references/components/slider.md b/doc/source/cn/references/components/slider.md
index 190e01d..049ff06 100644
--- a/doc/source/cn/references/components/slider.md
+++ b/doc/source/cn/references/components/slider.md
@@ -23,6 +23,8 @@ version: 2.1
 
 - `interval {number}`:值为毫秒数,此值设定 slider 切换时间间隔。当 `auto-play` 值为 `true` 时生效。
 
+- `offset-x-accuracy {number}`<sup class="wx-v">0.11+</sup>:控制`onscroll`事件触发的频率,默认值为10,表示两次`onscroll`事件之间Slider Page至少滚动了10px。注意,将该值设置为较小的数值会提高滚动事件采样的精度,但同时也会降低页面的性能。
+
 ## 样式
 
 - 通用样式:支持所有通用样式
@@ -42,6 +44,12 @@ version: 2.1
   事件中 event 对象属性:
   - `index`:展示的图片索引
 
+- `onscroll` <sup class="wx-v">0.11+</sup>: 列表发生滚动时将会触发该事件,事件的默认抽样率为10px,即列表每滚动10px触发一次,可通过属性`offset-accuracy`设置抽样率。    
+  
+  事件中 event 对象属性:  
+  - `offsetXRatio {number}`:表示当前页面的偏移比例,取值范围为[-1, 1],负值表示向左侧滚动,正值向右。例如,`-0.2`表示当前item有20%的区域被滚动到slider左侧边界以外,`0.3`表示当前item有30%的区域被滚动到slider右侧边界以外。
+
+
 - 通用事件
 
   支持所有通用事件:

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f4a57cc5/doc/source/cn/references/modules/dom.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/references/modules/dom.md b/doc/source/cn/references/modules/dom.md
index 2fa153a..ed4f1c2 100644
--- a/doc/source/cn/references/modules/dom.md
+++ b/doc/source/cn/references/modules/dom.md
@@ -30,6 +30,7 @@ version: 2.1
 - `node {Node}`:你要滚动到的那个节点
 - `options {Object}`:如下选项
   - `offset {number}`:一个到其可见位置的偏移距离,默认是 `0`
+  - `animated {boolean}` <sup class="wx-v">0.10+</sup>:是否需要附带滚动动画,默认是`true`
 
 #### 示例