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/04/17 04:14:32 UTC

[17/48] incubator-weex git commit: + [doc] add box-shadow doc , update textarea, scrolltoelement

+ [doc] add box-shadow doc , update textarea,scrolltoelement


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

Branch: refs/heads/0.12-dev
Commit: 7a091206235ad0ef2a32d61f4548431bd0a8d08c
Parents: 5529bb1
Author: \u9f50\u5c71 <su...@163.com>
Authored: Wed Mar 29 18:34:46 2017 +0800
Committer: \u9f50\u5c71 <su...@163.com>
Committed: Wed Mar 29 18:34:46 2017 +0800

----------------------------------------------------------------------
 doc/source/cn/references/common-style.md     | 82 ++++++++++++++++++-----
 doc/source/cn/references/components/input.md | 14 +++-
 doc/source/cn/references/modules/dom.md      |  1 +
 3 files changed, 81 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/7a091206/doc/source/cn/references/common-style.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/references/common-style.md b/doc/source/cn/references/common-style.md
index 7abe9d3..782849b 100644
--- a/doc/source/cn/references/common-style.md
+++ b/doc/source/cn/references/common-style.md
@@ -35,45 +35,45 @@ Weex \u5bf9\u4e8e\u957f\u5ea6\u503c\u76ee\u524d\u53ea\u652f\u6301*\u50cf\u7d20*\u503c\uff0c\u4e0d\u652f\u6301\u76f8\u5bf9\u5355\u4f4d\uff08`em`\u3001
   \u5916\u8fb9\u8ddd\uff0c\u5143\u7d20\u548c\u5143\u7d20\u4e4b\u95f4\u7684\u7a7a\u767d\u8ddd\u79bb\u3002\u503c\u7c7b\u578b\u4e3a length\uff0c\u9ed8\u8ba4\u503c 0
 
   \u53ef\u6709\u5982\u4e0b\u5199\u6cd5\uff1a
-  
+
   - `margin-left {length}`\uff1a\uff0c\u9ed8\u8ba4\u503c 0
   - `margin-right {length}`\uff1a\uff0c\u9ed8\u8ba4\u503c 0
   - `margin-top {length}`\uff1a\uff0c\u9ed8\u8ba4\u503c 0
   - `margin-bottom {length}`\uff1a\uff0c\u9ed8\u8ba4\u503c 0
 - border\uff1a
-  
+
   \u8bbe\u5b9a\u8fb9\u6846\uff0c`border` \u76ee\u524d\u4e0d\u652f\u6301\u7c7b\u4f3c\u8fd9\u6837 `border: 1 solid #ff0000;` \u7684\u7ec4\u5408\u5199\u6cd5\u3002
 
   \u53ef\u6709\u5982\u4e0b\u5199\u6cd5\uff1a
-  
+
   - `border-style`\uff1a
 
     \u8bbe\u5b9a\u8fb9\u6846\u6837\u5f0f\uff0c\u503c\u7c7b\u578b\u4e3a string\uff0c\u53ef\u9009\u503c\u4e3a `solid` | `dashed` | `dotted`\uff0c\u9ed8\u8ba4\u503c `solid`
 
     \u53ef\u6709\u5982\u4e0b\u5199\u6cd5\uff1a
-  
+
     - `border-left-style {string}`\uff1a\u53ef\u9009\u503c\u4e3a `solid` | `dashed` | `dotted`\uff0c\u9ed8\u8ba4\u503c `solid`
     - `border-top-style {string}`\uff1a\u53ef\u9009\u503c\u4e3a `solid` | `dashed` | `dotted`\uff0c\u9ed8\u8ba4\u503c `solid`
     - `border-right-style {string}`\uff1a\u53ef\u9009\u503c\u4e3a `solid` | `dashed` | `dotted`\uff0c\u9ed8\u8ba4\u503c `solid`
     - `border-bottom-style {string}`\uff1a\u53ef\u9009\u503c\u4e3a `solid` | `dashed` | `dotted`\uff0c\u9ed8\u8ba4\u503c `solid`
 
   - `border-width {length}`\uff1a
-  
+
     \u8bbe\u5b9a\u8fb9\u6846\u5bbd\u5ea6\uff0c\u975e\u8d1f\u503c, \u9ed8\u8ba4\u503c 0
 
     \u53ef\u6709\u5982\u4e0b\u5199\u6cd5\uff1a
-  
+
     - `border-left-width {length}`\uff1a\uff0c\u975e\u8d1f\u503c, \u9ed8\u8ba4\u503c 0
     - `border-top-width {length}`\uff1a\uff0c\u975e\u8d1f\u503c, \u9ed8\u8ba4\u503c 0
     - `border-right-width {length}`\uff1a\uff0c\u975e\u8d1f\u503c, \u9ed8\u8ba4\u503c 0
     - `border-bottom-width {length}`\uff1a\uff0c\u975e\u8d1f\u503c, \u9ed8\u8ba4\u503c 0
 
   - `border-color {color}`\uff1a
-  
+
     \u8bbe\u5b9a\u8fb9\u6846\u989c\u8272\uff0c\u9ed8\u8ba4\u503c `#000000`
-  
+
     \u53ef\u6709\u5982\u4e0b\u5199\u6cd5\uff1a
-  
+
     - `border-left-color {color}`\uff1a\uff0c\u9ed8\u8ba4\u503c `#000000`
     - `border-top-color {color}`\uff1a\uff0c\u9ed8\u8ba4\u503c `#000000`
     - `border-right-color {color}`\uff1a\uff0c\u9ed8\u8ba4\u503c `#000000`
@@ -83,7 +83,7 @@ Weex \u5bf9\u4e8e\u957f\u5ea6\u503c\u76ee\u524d\u53ea\u652f\u6301*\u50cf\u7d20*\u503c\uff0c\u4e0d\u652f\u6301\u76f8\u5bf9\u5355\u4f4d\uff08`em`\u3001
     \u8bbe\u5b9a\u5706\u89d2\uff0c\u9ed8\u8ba4\u503c 0
 
     \u53ef\u6709\u5982\u4e0b\u5199\u6cd5\uff1a
-  
+
     - `border-bottom-left-radius {length}`\uff1a\uff0c\u975e\u8d1f\u503c, \u9ed8\u8ba4\u503c 0
     - `border-bottom-right-radius {length}`\uff1a\uff0c\u975e\u8d1f\u503c, \u9ed8\u8ba4\u503c 0
     - `border-top-left-radius {length}`\uff1a\uff0c\u975e\u8d1f\u503c, \u9ed8\u8ba4\u503c 0
@@ -228,7 +228,7 @@ flex \u5c5e\u6027\u5b9a\u4e49\u4e86 flex \u6210\u5458\u9879\u53ef\u4ee5\u5360\u7528\u5bb9\u5668\u4e2d\u5269\u4f59\u7a7a\u95f4\u7684\u5927\u5c0f\u3002
 Weex \u652f\u6301 `position` \u5b9a\u4f4d\uff0c\u7528\u6cd5\u4e0e CSS position \u7c7b\u4f3c\u3002\u4e3a\u5143\u7d20\u8bbe\u7f6e `position` \u540e\uff0c\u53ef\u901a\u8fc7 `top`\u3001`right`\u3001`bottom`\u3001`left` \u56db\u4e2a\u5c5e\u6027\u8bbe\u7f6e\u5143\u7d20\u5750\u6807\u3002
 
 - `position {string}`\uff1a
-  
+
   \u8bbe\u7f6e\u5b9a\u4f4d\u7c7b\u578b\u3002\u53ef\u9009\u503c\u4e3a `relative` | `absolute` | `fixed` | `sticky`\uff0c\u9ed8\u8ba4\u503c\u4e3a `relative`\u3002
 
   - `relative` \u662f\u9ed8\u8ba4\u503c\uff0c\u6307\u7684\u662f\u76f8\u5bf9\u5b9a\u4f4d\uff1b
@@ -243,7 +243,7 @@ Weex \u652f\u6301 `position` \u5b9a\u4f4d\uff0c\u7528\u6cd5\u4e0e CSS position \u7c7b\u4f3c\u3002\u4e3a\u5143\u7d20\u8bbe\u7f6e
 **\u6ce8\u610f\uff1a**
 
 1. Weex \u76ee\u524d\u4e0d\u652f\u6301 `z-index` \u8bbe\u7f6e\u5143\u7d20\u5c42\u7ea7\u5173\u7cfb\uff0c\u4f46\u9760\u540e\u7684\u5143\u7d20\u5c42\u7ea7\u66f4\u9ad8\uff0c\u56e0\u6b64\uff0c\u5bf9\u4e8e\u5c42\u7ea7\u9ad8\u7684\u5143\u7d20\uff0c\u53ef\u5c06\u5176\u6392\u5217\u5728\u540e\u9762\u3002
-2. \u5982\u679c\u5b9a\u4f4d\u5143\u7d20\u8d85\u8fc7\u5bb9\u5668\u8fb9\u754c\uff0c\u5728 Android \u4e0b\uff0c\u8d85\u51fa\u90e8\u5206\u5c06**\u4e0d\u53ef\u89c1**\uff0c\u539f\u56e0\u5728\u4e8e Android \u7aef\u5143\u7d20 `overflow` \u9ed8\u8ba4\u503c\u4e3a `hidden`\uff0c\u4f46\u76ee\u524d Android \u6682\u4e0d\u652f\u6301\u8bbe\u7f6e `overflow: visible`\u3002 
+2. \u5982\u679c\u5b9a\u4f4d\u5143\u7d20\u8d85\u8fc7\u5bb9\u5668\u8fb9\u754c\uff0c\u5728 Android \u4e0b\uff0c\u8d85\u51fa\u90e8\u5206\u5c06**\u4e0d\u53ef\u89c1**\uff0c\u539f\u56e0\u5728\u4e8e Android \u7aef\u5143\u7d20 `overflow` \u9ed8\u8ba4\u503c\u4e3a `hidden`\uff0c\u4f46\u76ee\u524d Android \u6682\u4e0d\u652f\u6301\u8bbe\u7f6e `overflow: visible`\u3002
 
 ### \u793a\u4f8b
 
@@ -320,19 +320,19 @@ Weex \u652f\u6301\u56db\u79cd\u4f2a\u7c7b\uff1a`active`, `focus`, `disabled`, `enabled`
 
 <style scoped>
   .wrapper {
-    align-items: center; 
+    align-items: center;
     margin-top: 120px;
   }
   .title {
     font-size: 48px;
   }
   .logo {
-    width: 360px; 
+    width: 360px;
     height: 82px;
     background-color: red;
   }
   .logo:active {
-    width: 180px; 
+    width: 180px;
     height: 82px;
     background-color: green;
   }
@@ -450,6 +450,58 @@ Weex \u76ee\u524d\u53ea\u652f\u6301\u4e24\u79cd\u989c\u8272\u7684\u6e10\u53d8\uff0c\u6e10\u53d8\u65b9\u5411\u5982\u4e0b\uff1a
 </style>
 ```
 
+## \u9634\u5f71(box-shadow) <span class="api-version">v0.11+</span>
+
+Weex \u652f\u6301\u9634\u5f71\u5c5e\u6027\uff1a`active`, `focus`, `disabled`, `enabled` `inset(\u53ef\u9009)`,`offset-x`,`offset-y`, `blur-radius`,`color`
+
+
+### \u6ce8\u610f
+
+- box-shadow\u4ec5\u4ec5\u652f\u6301iOS
+
+### \u793a\u4f8b
+
+```html
+<template>
+    <div class="wrapper">
+        <div style="width:400px; height:60px;background-color: #FFE4C4; box-shadow:20px  10px rgb(255, 69, 0);">
+            <text class="title" style="text-align: center">Hello {{target}}</text>
+        </div>
+        <div style="margin-top: 80px;width:400px; height:60px;background-color: #FFE4C4; box-shadow: 20px  10px 5px rgba(255, 69, 0, 0.8);">
+            <text class="title" style="text-align: center">Hello {{target}}</text>
+        </div>
+        <div style="margin-top: 80px;width:400px; height:60px;background-color: #FFE4C4; box-shadow:inset 20px  10px 5px rgba(255, 69, 0, 0.8);">
+            <text class="title" style="text-align: center">Hello {{target}}</text>
+        </div>
+        <div style="margin-top: 80px;width:400px; height:60px;background-color: #FFE4C4; box-shadow:inset 20px  10px 5px rgb(255, 69, 0);">
+            <text class="title" style="text-align: center">Hello {{target}}</text>
+        </div>
+        <div style="margin-top: 80px;width:400px; height:60px;background-color: #FFE4C4; box-shadow:20px  10px 5px black;">
+            <text class="title" style="text-align: center">Hello {{target}}</text>
+        </div>
+        <div style="margin-top: 80px;width:400px; height:60px;background-color: #FFE4C4; box-shadow:20px  10px 5px #008B00;">
+            <text class="title" style="text-align: center">Hello {{target}}</text>
+        </div>
+    </div>
+</template>
+
+<style scoped>
+    .wrapper {align-items: center; margin-top: 120px;}
+    .title {font-size: 48px;}
+</style>
+
+<script>
+    module.exports = {
+        data: function () {
+            return {
+                logoUrl: 'https://alibaba.github.io/weex/img/weex_logo_blue@3x.png',
+                target: 'World'
+            };
+        }
+    };
+</script>
+```
+
 ## \u5176\u4ed6\u57fa\u672c\u6837\u5f0f
 
 - `opacity {number}`\uff1a\u53d6\u503c\u8303\u56f4\u4e3a [0, 1] \u533a\u95f4\u3002\u9ed8\u8ba4\u503c\u662f 1\uff0c\u5373\u5b8c\u5168\u4e0d\u900f\u660e\uff1b0 \u662f\u5b8c\u5168\u900f\u660e\uff1b0.5 \u662f 50% \u7684\u900f\u660e\u5ea6\u3002

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/7a091206/doc/source/cn/references/components/input.md
----------------------------------------------------------------------
diff --git a/doc/source/cn/references/components/input.md b/doc/source/cn/references/components/input.md
index 97d4787..546960c 100644
--- a/doc/source/cn/references/components/input.md
+++ b/doc/source/cn/references/components/input.md
@@ -25,6 +25,7 @@ Weex \u5185\u7f6e\u7684 `<input>` \u7ec4\u4ef6\u7528\u6765\u521b\u5efa\u63a5\u6536\u7528\u6237\u8f93\u5165\u5b57\u7b26\u7684\u8f93\u5165\u7ec4
 - `disabled {boolean}`\uff1a\u5e03\u5c14\u7c7b\u578b\u7684\u6570\u636e\uff0c\u8868\u793a\u662f\u5426\u652f\u6301\u8f93\u5165\u3002\u901a\u5e38 `click` \u4e8b\u4ef6\u5728 `disabled` \u63a7\u4ef6\u4e0a\u662f\u5931\u6548\u7684\u3002
 - `autofocus {boolean}`\uff1a\u5e03\u5c14\u7c7b\u578b\u7684\u6570\u636e\uff0c\u8868\u793a\u662f\u5426\u5728\u9875\u9762\u52a0\u8f7d\u65f6\u63a7\u4ef6\u81ea\u52a8\u83b7\u5f97\u8f93\u5165\u7126\u70b9\u3002
 - `maxlength {nubmer}`\uff1a<sup class="wx-v">v0.7</sup>\u4e00\u4e2a\u6570\u503c\u7c7b\u578b\u7684\u503c\uff0c\u8868\u793a\u8f93\u5165\u7684\u6700\u5927\u957f\u5ea6\u3002
+- `return-key-type {string}`\uff1a<sup class="wx-v">v0.11</sup>\u952e\u76d8enter\u952e\u7684\u7c7b\u578b\u3002
 
 ## \u6837\u5f0f
 
@@ -84,6 +85,12 @@ Weex \u5185\u7f6e\u7684 `<input>` \u7ec4\u4ef6\u7528\u6765\u521b\u5efa\u63a5\u6536\u7528\u6237\u8f93\u5165\u5b57\u7b26\u7684\u8f93\u5165\u7ec4
   \u4e8b\u4ef6\u4e2d event \u5bf9\u8c61\u5c5e\u6027\uff1a
 
   - `timestamp`: \u4e8b\u4ef6\u53d1\u751f\u65f6\u7684\u65f6\u95f4\u6233\u3002
+- `return`: \u952e\u76d8\u70b9\u51fb\u786e\u8ba4\u6309\u94ae\u3002
+
+    \u4e8b\u4ef6\u4e2d event \u5bf9\u8c61\u5c5e\u6027\uff1a
+
+    - `returnKeyType`: \u4e8b\u4ef6\u53d1\u751f\u65f6\u7684enter\u6309\u94ae\u5185\u7c7b\u578b\u3002
+    - `value`: \u89e6\u53d1\u4e8b\u4ef6\u7684\u7ec4\u4ef6\u7684\u6587\u672c\uff1b
 
 - \u901a\u7528\u4e8b\u4ef6
 
@@ -109,7 +116,12 @@ Weex \u5185\u7f6e\u7684 `<input>` \u7ec4\u4ef6\u7528\u6765\u521b\u5efa\u63a5\u6536\u7528\u6237\u8f93\u5165\u5b57\u7b26\u7684\u8f93\u5165\u7ec4
 - `blur()` <span class="api-version">v0.9+</span>
 
   `blur()` \u65b9\u6cd5\u7528\u4e8e\u4ece `input` \u7ec4\u4ef6\u4e2d\u79fb\u9664\u7126\u70b9\u5e76\u5173\u95ed\u8f6f\u952e\u76d8\uff08\u5982\u679c\u5b83\u5177\u6709\u7126\u70b9\uff09\u3002
-
+- `setSelectionRange(selectionStart,selectionEnd)`  <span class="api-version">v0.11+</span>\u8bbe\u7f6e\u6587\u672c\u9009\u533a
+  - `selectionStart {number}`\uff1a\u8bbe\u7f6e\u6587\u672c\u9009\u533a\u7684\u8d77\u59cb\u70b9
+  - `selectionEnd {number}`\uff1a\u8bbe\u7f6e\u6587\u672c\u9009\u533a\u7684\u8d77\u7ec8\u70b9
+- `getEditSelectionRange(callback[selectionStart,selectionEnd])`  <span class="api-version">v0.11+</span>\u8bbe\u7f6e\u6587\u672c\u9009\u533a
+    - `selectionStart {number}`\uff1a\u83b7\u53d6\u6587\u672c\u9009\u533a\u7684\u8d77\u59cb\u70b9
+    - `selectionEnd {number}`\uff1a\u83b7\u53d6\u6587\u672c\u9009\u533a\u7684\u8d77\u7ec8\u70b9
 ## \u7ea6\u675f
 
 \u76ee\u524d\u4e0d\u652f\u6301 `this.$el(id).value = ''` \u8fd9\u79cd\u65b9\u5f0f\u6539\u5199 input value\u3002\u53ea\u652f\u6301\u5728 `<input>` \u7ec4\u4ef6\u7684 `input`\u3001`change` \u4e8b\u4ef6\u4e2d\u6539\u5199\u3002

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/7a091206/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 b7473c2..c4fefdc 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}`\uff1a\u4f60\u8981\u6eda\u52a8\u5230\u7684\u90a3\u4e2a\u8282\u70b9
 - `options {Object}`\uff1a\u5982\u4e0b\u9009\u9879
   - `offset {number}`\uff1a\u4e00\u4e2a\u5230\u5176\u53ef\u89c1\u4f4d\u7f6e\u7684\u504f\u79fb\u8ddd\u79bb\uff0c\u9ed8\u8ba4\u662f `0`
+  - `animated {bool}`\uff1a\u8bbe\u7f6e\u662f\u5426\u6709\u6eda\u52a8\u52a8\u753b\uff0c\u9ed8\u8ba4\u662f true
 
 #### \u793a\u4f8b