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/01/18 08:36:16 UTC
[1/9] incubator-weex-site git commit: [WEEX-86][doc] Update refresh
component's document, fix event's name.
Repository: incubator-weex-site
Updated Branches:
refs/heads/master c49639653 -> 713696251
[WEEX-86][doc] Update refresh component's document, fix event's name.
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/27c2ab2f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/tree/27c2ab2f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/diff/27c2ab2f
Branch: refs/heads/master
Commit: 27c2ab2f3c49c3d3661e4fdc1e9a806fa9f964e9
Parents: 9f649ca
Author: miomin <69...@qq.com>
Authored: Thu Jan 18 14:34:41 2018 +0800
Committer: miomin <69...@qq.com>
Committed: Thu Jan 18 14:34:41 2018 +0800
----------------------------------------------------------------------
source/cn/references/components/refresh.md | 4 ----
source/references/components/refresh.md | 4 ++--
2 files changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/27c2ab2f/source/cn/references/components/refresh.md
----------------------------------------------------------------------
diff --git a/source/cn/references/components/refresh.md b/source/cn/references/components/refresh.md
index 6aba55b..7459f7e 100644
--- a/source/cn/references/components/refresh.md
+++ b/source/cn/references/components/refresh.md
@@ -132,10 +132,6 @@ version: 2.1
```
- 查看 [完整示例](http://dotwe.org/vue/26937c1c74022e79608af118b21bfbc7)
-## 使用提示
-
- - Android 上,在下拉过程中或 onrefresh 事件触发时,不支持 refresh view 的回推,而在 iOS 和 Html5 上是支持的。
-
## 示例
- [完整示例](http://dotwe.org/vue/26937c1c74022e79608af118b21bfbc7)
http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/27c2ab2f/source/references/components/refresh.md
----------------------------------------------------------------------
diff --git a/source/references/components/refresh.md b/source/references/components/refresh.md
index 5e8150f..5032c48 100644
--- a/source/references/components/refresh.md
+++ b/source/references/components/refresh.md
@@ -91,11 +91,11 @@ The `<refresh>` Component provide a pulldown-refresh function for some special c
## Events
-### `onrefresh`
+### `refresh`
- Triggered when the scroller or list is pulled down.
-### `onpullingdown` <span class="weex-version">v0.6.1+</span>
+### `pullingdown` <span class="weex-version">v0.6.1+</span>
- Triggered when the scroller or list is pulled down. The attributes `dy`, `pullingDistance`, `viewHeight` and `type` are accessible from the `event` object :
[7/9] incubator-weex-site git commit: [WEEX-86][doc] Update stream
document.
Posted by ha...@apache.org.
[WEEX-86][doc] Update stream document.
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/1342cddf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/tree/1342cddf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/diff/1342cddf
Branch: refs/heads/master
Commit: 1342cddfb827a2c46fdce34fac1ac31569118d71
Parents: 40b5aaf
Author: miomin <69...@qq.com>
Authored: Thu Jan 18 16:28:53 2018 +0800
Committer: miomin <69...@qq.com>
Committed: Thu Jan 18 16:28:53 2018 +0800
----------------------------------------------------------------------
source/cn/references/modules/stream.md | 73 ++---------------------------
source/references/modules/stream.md | 70 +--------------------------
2 files changed, 4 insertions(+), 139 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/1342cddf/source/cn/references/modules/stream.md
----------------------------------------------------------------------
diff --git a/source/cn/references/modules/stream.md b/source/cn/references/modules/stream.md
index fd83124..bae42f7 100644
--- a/source/cn/references/modules/stream.md
+++ b/source/cn/references/modules/stream.md
@@ -37,6 +37,7 @@ version: 2.1
- `statusText {string}`:状态描述文本
- `data {Object | string}`: 返回的数据,如果请求类型是 `json` 和 `jsonp`,则它就是一个 object ,如果不是,则它就是一个 string。
- `headers {Object}`:响应头
+
- `progressCallback {Function}`:关于请求状态的回调。 这个回调函数将在请求完成后就被调用:
- `readyState {number}`:当前状态
state:'1': 请求连接中
@@ -50,76 +51,8 @@ version: 2.1
### 注意
- 默认 Content-Type 是 'application/x-www-form-urlencoded'。
- - 如果你需要通过 `POST` json , 你需要将 Content-Type 设为 'application/json'。
+ - 如果你需要通过 `POST` json , 需要将 Content-Type 设为 'application/json'。
### Example
-```html
-<template>
- <div class="wrapper">
- <div class="group">
- <text class="title">Weex Star :</text>
- <text class="count">{{weexStar}}</text>
- </div>
- <div class="group">
- <text class="title">Vue Star :</text>
- <text class="count">{{vueStar}}</text>
- </div>
- </div>
-</template>
-
-<script>
- var stream = weex.requireModule('stream')
- export default {
- data () {
- return {
- weexStar: 'unknown',
- vueStar: 'unknown'
- }
- },
-
- methods: {
- getStarCount (repo, callback) {
- return stream.fetch({
- method: 'GET',
- type: 'json',
- url: 'https://api.github.com/repos/' + repo
- }, callback)
- }
- },
- created () {
- this.getStarCount('alibaba/weex', res => {
- this.weexStar = res.ok ? res.data.stargazers_count : '(network error)'
- })
- this.getStarCount('vuejs/vue', res => {
- this.vueStar = res.ok ? res.data.stargazers_count : '(network error)'
- })
- }
- }
-</script>
-
-
-<style scoped>
- .wrapper {
- flex-direction: column;
- justify-content: center;
- }
- .group {
- flex-direction: row;
- justify-content: center;
- margin-bottom: 40px;
- }
- .title {
- font-size: 45px;
- color: #888888;
- }
- .count {
- font-size: 45px;
- font-weight: bold;
- margin-left: 12px;
- color: #41B883;
- }
-</style>
-```
-
-[try it](http://dotwe.org/vue/29bbf2d49fc8a204f98240044bbe211a)
+[stream demo](http://dotwe.org/vue/e182a9fbbeb6f0763cd1df1baddf1e10)
http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/1342cddf/source/references/modules/stream.md
----------------------------------------------------------------------
diff --git a/source/references/modules/stream.md b/source/references/modules/stream.md
index ee56d22..0f8ccda 100644
--- a/source/references/modules/stream.md
+++ b/source/references/modules/stream.md
@@ -61,72 +61,4 @@ Start a network request, use two callbacks to receive server's response data.
### Example
-```html
-<template>
- <div class="wrapper">
- <div class="group">
- <text class="title">Weex Star :</text>
- <text class="count">{{weexStar}}</text>
- </div>
- <div class="group">
- <text class="title">Vue Star :</text>
- <text class="count">{{vueStar}}</text>
- </div>
- </div>
-</template>
-
-<script>
- var stream = weex.requireModule('stream')
- export default {
- data () {
- return {
- weexStar: 'unknown',
- vueStar: 'unknown'
- }
- },
-
- methods: {
- getStarCount (repo, callback) {
- return stream.fetch({
- method: 'GET',
- type: 'json',
- url: 'https://api.github.com/repos/' + repo
- }, callback)
- }
- },
- created () {
- this.getStarCount('alibaba/weex', res => {
- this.weexStar = res.ok ? res.data.stargazers_count : '(network error)'
- })
- this.getStarCount('vuejs/vue', res => {
- this.vueStar = res.ok ? res.data.stargazers_count : '(network error)'
- })
- }
- }
-</script>
-
-
-<style scoped>
- .wrapper {
- flex-direction: column;
- justify-content: center;
- }
- .group {
- flex-direction: row;
- justify-content: center;
- margin-bottom: 40px;
- }
- .title {
- font-size: 45px;
- color: #888888;
- }
- .count {
- font-size: 45px;
- font-weight: bold;
- margin-left: 12px;
- color: #41B883;
- }
-</style>
-```
-
-[try it](http://dotwe.org/vue/29bbf2d49fc8a204f98240044bbe211a)
+[stream demo](http://dotwe.org/vue/e182a9fbbeb6f0763cd1df1baddf1e10)
[4/9] incubator-weex-site git commit: [WEEX-86][doc] Update modal
document.
Posted by ha...@apache.org.
[WEEX-86][doc] Update modal document.
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/40b5aaf6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/tree/40b5aaf6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/diff/40b5aaf6
Branch: refs/heads/master
Commit: 40b5aaf631c6248af1b2b6f7f62dc445bb9cdb8d
Parents: aaf57d5
Author: miomin <69...@qq.com>
Authored: Thu Jan 18 15:48:15 2018 +0800
Committer: miomin <69...@qq.com>
Committed: Thu Jan 18 15:48:15 2018 +0800
----------------------------------------------------------------------
source/cn/references/modules/modal.md | 129 +++++++++++------------------
source/references/modules/modal.md | 123 +++++++++++----------------
2 files changed, 97 insertions(+), 155 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/40b5aaf6/source/cn/references/modules/modal.md
----------------------------------------------------------------------
diff --git a/source/cn/references/modules/modal.md b/source/cn/references/modules/modal.md
index 175748d..2ffe7a5 100644
--- a/source/cn/references/modules/modal.md
+++ b/source/cn/references/modules/modal.md
@@ -22,7 +22,17 @@ version: 2.1
- `message {string}`:展示的内容
- `duration {number}`:展示的持续时间(以秒为单位)
- Android: 如果时间长度大于3s,将使用一个被称为**LONG**的系统变量, 否则使用**SHORT**这个系统变量
- - iOS: 持续的时间同Duration相同。
+ - iOS: 持续的时间同Duration相同
+
+#### 基本用法
+```
+var modal = weex.requireModule('modal')
+modal.toast({
+ message: 'This is a toast',
+ duration: 0.3
+})
+```
+
### `alert(options, callback)`
@@ -35,6 +45,19 @@ version: 2.1
- `okTitle {string}`:确定按钮上显示的文字信息,默认是“OK”
- `callback {Function}`:用户操作完成后的回调
+#### 基本用法
+```
+var modal = weex.requireModule('modal')
+modal.alert({
+ message: 'This is a alert',
+ duration: 0.3
+}, function (value) {
+ console.log('alert callback', value)
+})
+```
+
+
+
### `confirm(options, callback)`
确认框用于使用户可以验证或者接受某些信息。当确认框出现后,用户需要点击确定或者取消按钮才能继续进行操作。
@@ -47,6 +70,18 @@ version: 2.1
- `cancelTitle {string}`:取消按钮上显示的文字信息,默认是 `Cancel`
- `callback {function (result)}`:用户操作完成后的回调,回调函数的参数 `result` 是确定按钮上的文字信息字符串
+#### 基本用法
+```
+var modal = weex.requireModule('modal')
+modal.confirm({
+ message: 'Do you confirm ?',
+ duration: 0.3
+}, function (value) {
+ console.log('confirm callback', value)
+})
+```
+
+
### `prompt(options, callback)`
提示框经常用于提示用户在进入页面前输入某个值。当提示框出现后,用户需要输入某个值,然后点击确认或取消按钮才能继续操作。
@@ -57,86 +92,22 @@ version: 2.1
- `message {string}`:提示框内要显示的文字信息
- `okTitle {string}`:确认按钮上显示的文字信息,默认是 `OK`
- `cancelTitle {string}`:取消按钮上显示的文字信息,默认是 `Cancel`
-- `callback {function (ret)}`:用户操作完成后的回调,回调函数的参数 `ret` 格式形如 `{ result: 'OK', data: 'hello world' }`,如下
+- `callback {function (ret)}`:用户操作完成后的回调,回调函数的参数 `ret` 格式形如 `{ result: 'OK', data: 'hello world' }`,如下:
- `result {string}`:用户按下的按钮上的文字信息
- `data {string}`:用户输入的文字信息
-
-## Example
-
-```html
-<template>
- <div class="wrapper">
- <text class="button" @click="showToast">Toast</text>
- <text class="button" @click="showAlert">Alert</text>
- <text class="button" @click="showConfirm">Confirm</text>
- <text class="button" @click="showPrompt">Prompt</text>
- </div>
-</template>
-
-<script>
- var modal = weex.requireModule('modal')
-
- export default {
- methods: {
- showToast (event) {
- console.log('will show toast')
- modal.toast({
- message: 'This is a toast',
- duration: 0.3
- })
- },
- showAlert (event) {
- console.log('will show alert')
- modal.alert({
- message: 'This is a alert',
- duration: 0.3
- }, function (value) {
- console.log('alert callback', value)
- })
- },
- showConfirm (event) {
- console.log('will show confirm')
- modal.confirm({
- message: 'Do you confirm ?',
- duration: 0.3
- }, function (value) {
- console.log('confirm callback', value)
- })
- },
- showPrompt (event) {
- console.log('will show prompt')
- modal.prompt({
- message: 'This is a prompt',
- duration: 0.3
- }, function (value) {
- console.log('prompt callback', value)
- })
- }
- }
- };
-</script>
-
-<style scoped>
- .wrapper {
- flex-direction: column;
- justify-content: center;
- }
- .button {
- font-size: 60px;
- width: 450px;
- text-align: center;
- margin-top: 30px;
- margin-left: 150px;
- padding-top: 20px;
- padding-bottom: 20px;
- border-width: 2px;
- border-style: solid;
- color: #666666;
- border-color: #DDDDDD;
- background-color: #F5F5F5
- }
-</style>
+#### 基本用法
+```
+var modal = weex.requireModule('modal')
+modal.prompt({
+ message: 'This is a prompt',
+ duration: 0.3
+}, function (value) {
+ console.log('prompt callback', value)
+})
```
-[try it](http://dotwe.org/vue/a7dddfb24edb72be947fc4eec3803f1d)
+
+## 示例
+
+[Modal demo](http://dotwe.org/vue/a7dddfb24edb72be947fc4eec3803f1d)
http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/40b5aaf6/source/references/modules/modal.md
----------------------------------------------------------------------
diff --git a/source/references/modules/modal.md b/source/references/modules/modal.md
index 04d89a3..4005769 100644
--- a/source/references/modules/modal.md
+++ b/source/references/modules/modal.md
@@ -22,6 +22,16 @@ A toast provides simple feedback about an operation in a small popup. For exampl
- For Android: If the duration is longer than 3, it will use a system defined variable called **LONG**, otherwise it will use another variable called **SHORT**
- For iOS: It will show the toast during the specified time.
+#### Basic Usage
+```
+var modal = weex.requireModule('modal')
+modal.toast({
+ message: 'This is a toast',
+ duration: 0.3
+})
+```
+
+
### alert(options, callback)
An alert box is often used if you want to make sure information comes through to the user.
@@ -36,6 +46,18 @@ When an alert box pops up, the user will have to click "OK" to proceed.
This method has a callback function whose arguments will be:
- `result` (string): the title text of the confirm button that clicked by user.
+#### Basic Usage
+```
+var modal = weex.requireModule('modal')
+modal.alert({
+ message: 'This is a alert',
+ duration: 0.3
+}, function (value) {
+ console.log('alert callback', value)
+})
+```
+
+
### confirm(options, callback)
A confirm box is often used if you want the user to verify or accept something.
@@ -51,6 +73,18 @@ When a confirm box pops up, the user will have to click either confirm or cancel
This method has a callback function whose arguments will be:
- `result`(string): the title text of the button that clicked by user.
+#### Basic Usage
+```
+var modal = weex.requireModule('modal')
+modal.confirm({
+ message: 'Do you confirm ?',
+ duration: 0.3
+}, function (value) {
+ console.log('confirm callback', value)
+})
+```
+
+
### prompt(options, callback)
A prompt box is often used if you want the user to input a value before entering a page.
@@ -67,81 +101,18 @@ When a prompt box pops up, the user will have to click either confirm or cancel
- `result` (string): the title of the button that clicked by user.
- `data` (string): the value of the text that entered by user.
-## Example
-
-```html
-<template>
- <div class="wrapper">
- <text class="button" @click="showToast">Toast</text>
- <text class="button" @click="showAlert">Alert</text>
- <text class="button" @click="showConfirm">Confirm</text>
- <text class="button" @click="showPrompt">Prompt</text>
- </div>
-</template>
-
-<script>
- var modal = weex.requireModule('modal')
-
- export default {
- methods: {
- showToast (event) {
- console.log('will show toast')
- modal.toast({
- message: 'This is a toast',
- duration: 0.3
- })
- },
- showAlert (event) {
- console.log('will show alert')
- modal.alert({
- message: 'This is a alert',
- duration: 0.3
- }, function (value) {
- console.log('alert callback', value)
- })
- },
- showConfirm (event) {
- console.log('will show confirm')
- modal.confirm({
- message: 'Do you confirm ?',
- duration: 0.3
- }, function (value) {
- console.log('confirm callback', value)
- })
- },
- showPrompt (event) {
- console.log('will show prompt')
- modal.prompt({
- message: 'This is a prompt',
- duration: 0.3
- }, function (value) {
- console.log('prompt callback', value)
- })
- }
- }
- };
-</script>
-
-<style scoped>
- .wrapper {
- flex-direction: column;
- justify-content: center;
- }
- .button {
- font-size: 60px;
- width: 450px;
- text-align: center;
- margin-top: 30px;
- margin-left: 150px;
- padding-top: 20px;
- padding-bottom: 20px;
- border-width: 2px;
- border-style: solid;
- color: #666666;
- border-color: #DDDDDD;
- background-color: #F5F5F5
- }
-</style>
+#### Basic Usage
```
+var modal = weex.requireModule('modal')
+modal.prompt({
+ message: 'This is a prompt',
+ duration: 0.3
+}, function (value) {
+ console.log('prompt callback', value)
+})
+```
+
+
+## Example
-[try it](http://dotwe.org/vue/a7dddfb24edb72be947fc4eec3803f1d)
+[Modal demo](http://dotwe.org/vue/a7dddfb24edb72be947fc4eec3803f1d)
[9/9] incubator-weex-site git commit: [doc] Update loading
component's document (#38)
Posted by ha...@apache.org.
[doc] Update loading component's document (#38)
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/71369625
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/tree/71369625
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/diff/71369625
Branch: refs/heads/master
Commit: 7136962511719d973c35728bd11f0f4266ede750
Parents: 1f8cf2e 1342cdd
Author: Hanks <zh...@gmail.com>
Authored: Thu Jan 18 16:35:35 2018 +0800
Committer: Hanks <zh...@gmail.com>
Committed: Thu Jan 18 16:35:35 2018 +0800
----------------------------------------------------------------------
source/cn/references/components/loading.md | 174 ++++++++++--------------
source/cn/references/components/refresh.md | 4 -
source/cn/references/modules/modal.md | 129 +++++++-----------
source/cn/references/modules/stream.md | 73 +---------
source/references/components/loading.md | 106 +++++++++++++++
source/references/components/refresh.md | 4 +-
source/references/modules/modal.md | 123 +++++++----------
source/references/modules/stream.md | 70 +---------
8 files changed, 284 insertions(+), 399 deletions(-)
----------------------------------------------------------------------
[2/9] incubator-weex-site git commit: [WEEX-86][doc] Update loading
component's document.
Posted by ha...@apache.org.
[WEEX-86][doc] Update loading component's document.
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/53d37f00
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/tree/53d37f00
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/diff/53d37f00
Branch: refs/heads/master
Commit: 53d37f00c6a7bb8b45076e30faaffd30b7a9df27
Parents: 27c2ab2
Author: miomin <69...@qq.com>
Authored: Thu Jan 18 14:53:41 2018 +0800
Committer: miomin <69...@qq.com>
Committed: Thu Jan 18 14:53:41 2018 +0800
----------------------------------------------------------------------
source/cn/references/components/loading.md | 174 ++++++++++--------------
source/references/components/loading.md | 106 +++++++++++++++
2 files changed, 181 insertions(+), 99 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/53d37f00/source/cn/references/components/loading.md
----------------------------------------------------------------------
diff --git a/source/cn/references/components/loading.md b/source/cn/references/components/loading.md
index 08db367..085b603 100644
--- a/source/cn/references/components/loading.md
+++ b/source/cn/references/components/loading.md
@@ -2,127 +2,103 @@
title: <loading>
type: references
group: 内置组件
-order: 8.08
+order: 8.09
version: 2.1
---
# <loading>
-<span class="weex-version">v0.6.1+</span>
+### <span class="weex-version">v0.6.1+</span>
-`<loading>` 为 `<scroller>` 和 `<list>` 提供上拉加载功能。用法与特性与 `<refresh>` 类似, 是 `<scroller>` 和 `<list>` 的子组件,且只能在被 `<scroller>` 和 `<list>` 包含时才能被正确的渲染。
+`<loading>` 为容器提供上拉加载功能,用法和属性与 `<refresh>` 类似。
+> **注意:**`<loading>` 是 `<scroller>`、`<list>`、`<hlist>`、`<vlist>`、`<waterfall>` 的子组件,只能在被它们包含时才能被正确渲染。
+
+ - 简单示例:
+
+```
+<list>
+ ...
+ ...
+ <loading>
+ ...
+ </loading>
+</list>
+```
+ - 查看 [完整示例](http://dotwe.org/vue/d1f0283206f66fec6549f7896e6c6164)
## 子组件
-- [`<text>`](./text.html)
-- [`<image>`](./image.html)
-- `<loading-indicator>`: `<refresh>` 和 `<loading>` 组件的子组件,拥有默认的动画效果的实现。
+ - 诸如 `<text>`、`<image>` 之类的任何组件,都可以放到 `<loading>` 进行渲染。
-## 特性
+ - 特殊子组件 `<loading-indicator>`: 只能作为 `<refresh>` 和 `<loading>` 的子组件使用,拥有默认的动画效果实现。
-- `display {string}`:可选值为 `show` 或者 `hide`,仅隐藏 `<indicator>`,`<loading>` 其他子组件依然可见,`loading` 事件仍会被触发。
+ - 简单示例:
-## 样式
+```
+<loading>
+ <text>Loading</text>
+ <loading-indicator></loading-indicator>
+ ...
+</loading>
+```
+ - 查看 [完整示例](http://dotwe.org/vue/d1f0283206f66fec6549f7896e6c6164)
-支持所有通用样式。
+## 属性
-- 盒模型
-- `flexbox` 布局
-- `position`
-- `opacity`
-- `background-color`
+| 属性名 | 类型 | 值 | 默认值 |
+| ------------- | ------ | -------------------------- | ------- |
+| `display` | String | show / hide | show |
-查看 [组件通用样式](../common-style.html)
+### `display`
-## 事件
+ - `show`:如果 `<loading>` 中包含 `<loading-indicator>`,则将其显示并开始默认动画。
-- `loading`:加载时被触发。
+ - `hide`:收起 loading view,如果 `<loading>` 中包含 `<loading-indicator>`,则将其视图隐藏。
-## 约束
+> **注意:** `display` 的设置必须成对出现,即设置 `display="show"`,必须有对应的 `display="hide"`。
-- `<loading>` 不支持 `remove`,v0.9 版本会修复。
-- `display` 值为 `show` 或 `hide`。仅隐藏 `<indicator>`,`<loading>` 其他子组件依然可见,`loading` 事件仍会被触发。
+ - 简单示例:
- 如果需要 `<loading>` hide 时隐藏文案并不再触发事件,有两种解决方法:
+ ```
+ <template>
+ <list>
+ ...
+ ...
+ <loading @loading="onloading" :display="loadinging ? 'show' : 'hide'">
+ ...
+ </loading>
+ ...
+ </list>
+ </template>
- 1. 修改提示文案,并在 `loading` 事件中添加判断逻辑;
- 2. v0.9+ 可通过 `remove` 解决。
+ <script>
+ ...
+ methods: {
+ onloading (event) {
+ this.loadinging = true
+ setTimeout(() => {
+ this.loadinging = false
+ }, 2000)
+ },
+ }
+ </script>
+ ```
+ - 查看 [完整示例](http://dotwe.org/vue/d1f0283206f66fec6549f7896e6c6164)
-- 只能通过 `display` 特性进行展示和隐藏,且必须成对出现,即设置 `display="show"`,必须有对应的 `display="hide"`。
+ - 支持所有通用属性。查看 [组件通用属性](../common-attrs.html)
-## 示例
+## 样式
-```html
-<template>
- <scroller class="scroller">
- <div class="cell" v-for="num in lists">
- <div class="panel">
- <text class="text">{{num}}</text>
- </div>
- </div>
- <loading class="loading" @loading="onloading" :display="showLoading">
- <text class="indicator">Loading ...</text>
- </loading>
- </scroller>
-</template>
-
-<script>
- const modal = weex.requireModule('modal')
- const LOADMORE_COUNT = 4
-
- export default {
- data () {
- return {
- showLoading: 'hide',
- lists: [1, 2, 3, 4, 5]
- }
- },
- methods: {
- onloading (event) {
- modal.toast({ message: 'loading', duration: 1 })
- this.showLoading = 'show'
- setTimeout(() => {
- const length = this.lists.length
- for (let i = length; i < length + LOADMORE_COUNT; ++i) {
- this.lists.push(i + 1)
- }
- this.showLoading = 'hide'
- }, 1500)
- }
- }
- }
-</script>
-
-<style scoped>
- .panel {
- width: 600px;
- height: 250px;
- margin-left: 75px;
- margin-top: 35px;
- margin-bottom: 35px;
- flex-direction: column;
- justify-content: center;
- border-width: 2px;
- border-style: solid;
- border-color: #DDDDDD;
- background-color: #F5F5F5;
- }
- .text {
- font-size: 50px;
- text-align: center;
- color: #41B883;
- }
- .loading {
- justify-content: center;
- }
- .indicator {
- color: #888888;
- font-size: 42px;
- padding-top: 20px;
- padding-bottom: 20px;
- text-align: center;
- }
-</style>
-```
+ - 支持所有通用样式。查看 [组件通用样式](../common-style.html)
+
+## 事件
+
+### `loading`
+
+ - 当 `<scroller>`、`<list>`、`<hlist>`、`<vlist>`、`<waterfall>` 被上拉时触发。
+
+ - 查看 [完整示例](http://dotwe.org/vue/d1f0283206f66fec6549f7896e6c6164)
+
+## 示例
-[Try it](http://dotwe.org/vue/d5c1b2336a703a6e6e47c303af41ffcd)
+ - [完整示例](http://dotwe.org/vue/d1f0283206f66fec6549f7896e6c6164)
http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/53d37f00/source/references/components/loading.md
----------------------------------------------------------------------
diff --git a/source/references/components/loading.md b/source/references/components/loading.md
new file mode 100644
index 0000000..fc4389e
--- /dev/null
+++ b/source/references/components/loading.md
@@ -0,0 +1,106 @@
+---
+title: <loading>
+type: references
+group: Build-in Components
+order: 8.09
+version: 2.1
+---
+
+# <loading>
+
+### <span class="weex-version">v0.6.1+</span>
+
+The `<loading>` Component provide a pullup to loading function for some special containers, its usage and attributes are similar to the `<refresh>` Component.
+> **Note:** To be rendered properly, the `<loading>` Component must appear inside the special Component such as `<scroller>`、`<list>`、`<hlist>`、`<vlist>`、`<waterfall>`.
+
+ - Example:
+
+```
+<list>
+ ...
+ ...
+ <loading>
+ ...
+ </loading>
+</list>
+```
+
+ - Complete example goes [here](http://dotwe.org/vue/d1f0283206f66fec6549f7896e6c6164)
+
+## Child Components
+
+ - Any other components, like the `<text>` and `<image>` components, can be put inside the loading component.
+
+ - `<loading-indicator>`: This is a dedicated component which provides a default loading animation effect, can only be used inside the `<refresh>` or the `<loading>` components.
+
+ - Example:
+
+```
+<loading>
+ <text>Loading</text>
+ <loading-indicator></loading-indicator>
+ ...
+</loading>
+```
+ - Complete example goes [here](http://dotwe.org/vue/d1f0283206f66fec6549f7896e6c6164)
+
+## Attributes
+
+ - Support all common attributes, check out [common attributes](../common/common-attrs)
+
+| Attribute | Type | Value | Default Value |
+| ------------- | ------ | -------------------------- | ------- |
+| `display` | String | show / hide | show |
+
+#### `display`
+
+ - `show`:The loading animation will be started if a `<loading-indicator>` is included in the loading component.
+
+ - `hide`:Collapse the loading view. It also hides the `<loading-indicator>` and stops the loading animation if there's a `<loading-indicator>` included in the loading component.
+
+> **Note:** The visibility of `<loading>` component can be controlled by display attribute with the value show and hide. A `display="show"` should always be paired with a `display="hide"` statement.
+
+ - Example:
+
+```
+<template>
+ <list>
+ ...
+ ...
+ <loading @loading="onloading" :display="loadinging ? 'show' : 'hide'">
+ ...
+ </loading>
+ ...
+ </list>
+</template>
+
+<script>
+ ...
+ methods: {
+ onloading (event) {
+ this.loadinging = true
+ setTimeout(() => {
+ this.loadinging = false
+ }, 2000)
+ },
+ }
+</script>
+```
+ - Complete example goes [here](http://dotwe.org/vue/d1f0283206f66fec6549f7896e6c6164)
+
+## Styles
+
+ - Please check out the [common styles](../common/common-style)
+
+## Events
+
+### `onloading`
+
+ - Triggered when the scroller or list is pulled up.
+
+ - Complete example goes [here](http://dotwe.org/vue/d1f0283206f66fec6549f7896e6c6164)
+
+
+## Example
+
+ - Complete example goes [here](http://dotwe.org/vue/d1f0283206f66fec6549f7896e6c6164)
[5/9] incubator-weex-site git commit: fix markdown.
Posted by ha...@apache.org.
fix markdown.
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/319d390d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/tree/319d390d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/diff/319d390d
Branch: refs/heads/master
Commit: 319d390d1940a3bb1852070d340b8794d847b34d
Parents: 910fbcb
Author: MrRaindrop <te...@gmail.com>
Authored: Thu Jan 18 15:50:11 2018 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu Jan 18 15:50:11 2018 +0800
----------------------------------------------------------------------
source/guide/extend-web-render.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/319d390d/source/guide/extend-web-render.md
----------------------------------------------------------------------
diff --git a/source/guide/extend-web-render.md b/source/guide/extend-web-render.md
index 8eb5871..8a0d627 100644
--- a/source/guide/extend-web-render.md
+++ b/source/guide/extend-web-render.md
@@ -8,7 +8,7 @@ version: 2.1
# Extend Web components
-Vue.js is an independent front-end framework. In the browser, you can not use the Weex container for page rendering. So, the two things are the same: (1) for the Weex platform to expand Vue.js Web components. (2) directly using Vue.js to develop a Web component. The development of components can refer to its documentation: [component](https://vuejs.org/v2/guide/components.html). It is also recommended to use the ```.vue``` file to write components. How to use it: [Single file component](https://vuejs.org/v2/guide/single-file-components.html).
+Vue.js is an independent front-end framework. In the browser, you can not use the Weex container for page rendering. So, the two things are the same: (1) for the Weex platform to expand Vue.js Web components. (2) directly using Vue.js to develop a Web component. The development of components can refer to its documentation: [component](https://vuejs.org/v2/guide/components.html). It is also recommended to use the `.vue` file to write components. How to use it: [Single file component](https://vuejs.org/v2/guide/single-file-components.html).
# Extend Web renderer's built-in components
@@ -20,7 +20,7 @@ We current use [weex-vue-render](https://github.com/weexteam/weex-vue-render) fo
## Example of extension for weex built-in components.
-To extend ```<sidebar>``` as an example, you should first write the logic of the component itself:
+To extend `<sidebar>` as an example, you should first write the logic of the component itself:
```html
<!-- sidebar.vue -->
@@ -44,14 +44,14 @@ To extend ```<sidebar>``` as an example, you should first write the logic of the
</script>
```
-And then register the ```<sidebar>``` component globally before using it:
+And then register the `<sidebar>` component globally before using it:
```javascript
import Vue from 'vue'
import weex from 'weex-vue-render'
import Sidebar from './path/to/sidebar.vue'
weex.init(Vue)
-// register the ```<sidebar>``` component globally
+// register the `<sidebar>` component globally
weex.registerComponent('sidebar', Sidebar)
// or:
// Vue.component('sidebar', Sidebar)
@@ -67,14 +67,14 @@ In addition to the common components, Weex also provides a common module, you ca
## Register the module
-If we import the ```weex-vue-render``` library, we can get the weex variable globally. You can register the module using the ```registerModule```method.
+If we import the `weex-vue-render` library, we can get the weex variable globally. You can register the module using the `registerModule`method.
## API format
+ `registerModule`
- 1. ```name```: {String} Required, module name.
- 2. ```define```: {Object} Required, module definition.
+ 1. `name`: {String} Required, module name.
+ 2. `define`: {Object} Required, module definition.
3. `meta`: {Object} Optional, module meta info. Basically you won't need this except you want to pass a non iterable attribute or method from your module implementation object. In this case you should pass a `{ registerType: 'assignment' }` object to it. Otherwise only the iterables will be registered in the module.
## The example of register module
[6/9] incubator-weex-site git commit: fix link
Posted by ha...@apache.org.
fix link
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/4fcbfd21
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/tree/4fcbfd21
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/diff/4fcbfd21
Branch: refs/heads/master
Commit: 4fcbfd21d10ac2f94e683209f48231f25aa4e610
Parents: 319d390
Author: MrRaindrop <te...@gmail.com>
Authored: Thu Jan 18 16:28:07 2018 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu Jan 18 16:28:07 2018 +0800
----------------------------------------------------------------------
source/cn/references/modules/dom.md | 2 +-
source/references/modules/dom.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/4fcbfd21/source/cn/references/modules/dom.md
----------------------------------------------------------------------
diff --git a/source/cn/references/modules/dom.md b/source/cn/references/modules/dom.md
index 712dccf..1417f84 100644
--- a/source/cn/references/modules/dom.md
+++ b/source/cn/references/modules/dom.md
@@ -57,7 +57,7 @@ version: 2.1
#### 示例
-
+[获取 box 的布局信息](http://dotwe.org/vue/d69ec16302e06300096c7285baef538a)
### addRule(type, contentObject) <span class="api-version">v0.12.0+</span>
http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/4fcbfd21/source/references/modules/dom.md
----------------------------------------------------------------------
diff --git a/source/references/modules/dom.md b/source/references/modules/dom.md
index ad0408f..b4478b2 100644
--- a/source/references/modules/dom.md
+++ b/source/references/modules/dom.md
@@ -61,7 +61,7 @@ If you want to get the bounding rect of outside viewport of the weex container,
#### Example
-
+[get box's rect](http://dotwe.org/vue/d69ec16302e06300096c7285baef538a)
### addRule(type, contentObject) <span class="api-version">v0.12.0+</span>
[3/9] incubator-weex-site git commit: Merge branch 'master' of
https://github.com/apache/incubator-weex-site
Posted by ha...@apache.org.
Merge branch 'master' of https://github.com/apache/incubator-weex-site
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/aaf57d5e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/tree/aaf57d5e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/diff/aaf57d5e
Branch: refs/heads/master
Commit: aaf57d5e26a18c43ef953629cf95f8bb2239a82b
Parents: 53d37f0 fd30959
Author: miomin <69...@qq.com>
Authored: Thu Jan 18 14:59:01 2018 +0800
Committer: miomin <69...@qq.com>
Committed: Thu Jan 18 14:59:01 2018 +0800
----------------------------------------------------------------------
_config.yml | 38 +-
_config_cn.yml | 68 +-
_drafts/difference-with-web.en.md | 4 +-
_drafts/extend-js-framework.md | 168 ++
_drafts/extend-to-android.md | 175 ++
_drafts/sandbox.md | 36 +
_drafts/using-vue.md | 59 +
advanced/extend-to-android.md | 175 --
package-lock.json | 1989 ++++++++++++++----
package.json | 10 +-
source/bug-report-guidelines.md | 66 +
source/cn/bug-report-guidelines.md | 59 +
source/cn/contributing.md | 102 +-
source/cn/development-process.md | 94 +
.../guide/advanced/use-vuex-and-vue-router.md | 6 +-
source/cn/guide/extend-android.md | 106 +-
source/cn/guide/extend-web-render.md | 35 +-
source/cn/guide/front-end-frameworks.md | 23 +-
source/cn/guide/index.md | 190 +-
source/cn/guide/integrate-devtool-to-android.md | 7 +-
source/cn/guide/integrate-to-your-app.md | 90 +-
source/cn/guide/use-vue.md | 11 +
source/cn/references/broadcast-channel.md | 113 +
source/cn/references/components/a.md | 88 +-
source/cn/references/components/cell.md | 64 +-
source/cn/references/components/div.md | 2 +-
source/cn/references/components/image.md | 245 +--
source/cn/references/components/indicator.md | 91 +-
source/cn/references/components/input.md | 15 +-
source/cn/references/components/list.md | 66 +-
source/cn/references/components/scroller.md | 2 +-
source/cn/references/components/slider.md | 2 +-
source/cn/references/components/switch.md | 145 +-
source/cn/references/components/text.md | 2 +-
source/cn/references/components/textarea.md | 2 +-
source/cn/references/components/waterfall.md | 2 +-
source/cn/references/components/web.md | 190 +-
source/cn/references/index.md | 9 +
source/cn/references/js-framework-apis.md | 67 -
source/cn/references/modules/animation.md | 132 +-
source/cn/references/modules/clipboard.md | 2 +-
source/cn/references/modules/dom.md | 255 +--
source/cn/references/modules/globalevent.md | 2 +-
source/cn/references/modules/meta.md | 2 +-
source/cn/references/modules/modal.md | 2 +-
source/cn/references/modules/navigator.md | 2 +-
source/cn/references/modules/picker.md | 2 +-
source/cn/references/modules/stream.md | 2 +-
source/cn/references/modules/websocket.md | 6 +-
source/cn/references/modules/webview.md | 2 +-
source/cn/references/weex-variable.md | 147 +-
source/cn/tools/toolkit.md | 246 +--
source/cn/wiki/gestures.md | 1 +
source/cn/wiki/images/css-boxmodel.png | Bin 0 -> 12581 bytes
source/cn/wiki/images/css-flexbox-align.jpg | Bin 0 -> 35005 bytes
source/cn/wiki/images/css-flexbox-justify.svg | 59 +
source/cn/wiki/images/css-flexbox-sample.png | Bin 0 -> 3210 bytes
source/cn/wiki/images/nav.png | Bin 0 -> 83497 bytes
source/contributing.md | 97 +-
source/development-process.md | 93 +
.../guide/advanced/use-vuex-and-vue-router.md | 18 +-
source/guide/create-a-plugin.md | 131 ++
source/guide/extend-android.md | 257 +--
source/guide/extend-ios.md | 2 +-
source/guide/extend-js-framework.md | 2 +-
source/guide/extend-web-render.md | 39 +-
source/guide/front-end-frameworks.md | 27 +-
source/guide/images/different-switch.png | Bin 0 -> 29228 bytes
source/guide/images/toolkit-preview.png | Bin 0 -> 180414 bytes
source/guide/index.md | 126 +-
source/guide/integrate-devtool-to-android.md | 7 +-
source/guide/integrate-to-your-app.md | 225 +-
source/guide/set-up-env.md | 88 +-
source/guide/use-vue.md | 268 +++
source/guide/using-rax.md | 7 -
source/guide/using-vue.md | 59 -
source/references/broadcast-channel.md | 113 +
source/references/components/a.md | 74 +-
source/references/components/cell.md | 6 +-
source/references/components/div.md | 2 +-
source/references/components/image.md | 221 +-
source/references/components/index.md | 24 +
source/references/components/indicator.md | 91 +-
source/references/components/input.md | 55 +-
source/references/components/list.md | 115 +-
source/references/components/refresh.md | 2 +-
source/references/components/scroller.md | 36 +-
source/references/components/slider.md | 2 +-
source/references/components/switch.md | 143 +-
source/references/components/text.md | 2 +-
source/references/components/textarea.md | 2 +-
source/references/components/video.md | 2 +-
source/references/components/waterfall.md | 2 +-
source/references/components/web.md | 181 +-
source/references/images/BroadcastChannel.png | Bin 0 -> 50463 bytes
.../references/images/image-resize-property.png | Bin 0 -> 730054 bytes
source/references/index.md | 14 +-
source/references/js_framework-apis.md | 67 -
source/references/modules/animation.md | 136 +-
source/references/modules/clipboard.md | 2 +-
source/references/modules/dom.md | 258 +--
source/references/modules/globalevent.md | 2 +-
source/references/modules/index.md | 20 +
source/references/modules/meta.md | 2 +-
source/references/modules/modal.md | 2 +-
source/references/modules/navigator.md | 24 +-
source/references/modules/picker.md | 2 +-
source/references/modules/stream.md | 2 +-
source/references/modules/websocket.md | 6 +-
source/references/modules/webview.md | 2 +-
source/references/weex-variable.md | 151 +-
source/resources.md | 49 +
source/tools/index.md | 2 +-
source/tools/toolkit.md | 218 +-
source/wiki/common-styles.md | 2 +-
source/wiki/faq.md | 1 -
source/wiki/gestures.md | 1 +
source/wiki/images/css-boxmodel.png | Bin 0 -> 12581 bytes
source/wiki/images/css-flexbox-align.jpg | Bin 0 -> 35005 bytes
source/wiki/images/css-flexbox-justify.svg | 59 +
source/wiki/images/css-flexbox-sample.png | Bin 0 -> 3210 bytes
source/wiki/images/nav.png | Bin 0 -> 83497 bytes
themes/weex/languages/cn.yml | 1 +
themes/weex/languages/en.yml | 1 +
themes/weex/layout/_partial/article.ejs | 4 +-
themes/weex/layout/_partial/header.ejs | 7 +-
themes/weex/layout/_partial/post/summary.ejs | 21 +-
themes/weex/layout/index.ejs | 149 +-
themes/weex/scripts/helper.js | 6 +-
themes/weex/source/css/common.scss | 2 +-
themes/weex/source/css/media-queries.scss | 21 +
themes/weex/source/css/partial/article.scss | 45 +-
themes/weex/source/css/partial/highlight.scss | 4 +-
themes/weex/source/css/partial/summary.scss | 3 +
themes/weex/source/css/post.scss | 11 +-
themes/weex/source/css/variable.scss | 2 +-
themes/weex/source/js/common.js | 73 +-
137 files changed, 5460 insertions(+), 3909 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/aaf57d5e/source/references/components/refresh.md
----------------------------------------------------------------------
[8/9] incubator-weex-site git commit: [doc] fix markdown (#39)
Posted by ha...@apache.org.
[doc] fix markdown (#39)
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/1f8cf2e6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/tree/1f8cf2e6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/diff/1f8cf2e6
Branch: refs/heads/master
Commit: 1f8cf2e697a017be6570cc8c50483e35f78bcc76
Parents: c496396 4fcbfd2
Author: Hanks <zh...@gmail.com>
Authored: Thu Jan 18 16:34:40 2018 +0800
Committer: Hanks <zh...@gmail.com>
Committed: Thu Jan 18 16:34:40 2018 +0800
----------------------------------------------------------------------
source/cn/references/modules/dom.md | 2 +-
source/guide/extend-web-render.md | 14 +++++++-------
source/references/modules/dom.md | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/1f8cf2e6/source/cn/references/modules/dom.md
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/1f8cf2e6/source/references/modules/dom.md
----------------------------------------------------------------------