Repository: incubator-weex-site Updated Branches: refs/heads/master 1a6d8cedd -> fd309599c
update doc for input 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/19aa2e91 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/tree/19aa2e91 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex-site/diff/19aa2e91 Branch: refs/heads/master Commit: 19aa2e914e9820ad21df7d81c01a240e590890f7 Parents: e897c58 Author: moxun.ljf <[email protected]> Authored: Thu Jan 18 12:26:55 2018 +0800 Committer: moxun.ljf <[email protected]> Committed: Thu Jan 18 12:26:55 2018 +0800 ---------------------------------------------------------------------- source/cn/references/components/input.md | 13 +++++-- source/references/components/input.md | 53 +++++++++++++++++---------- 2 files changed, 42 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/19aa2e91/source/cn/references/components/input.md ---------------------------------------------------------------------- diff --git a/source/cn/references/components/input.md b/source/cn/references/components/input.md index 654a27d..c97dc04 100644 --- a/source/cn/references/components/input.md +++ b/source/cn/references/components/input.md @@ -8,11 +8,11 @@ version: 2.1 # <input> -Weex å ç½®ç `<input>` ç»ä»¶ç¨æ¥åå»ºæ¥æ¶ç¨æ·è¾å ¥å符çè¾å ¥ç»ä»¶ã `<input>` ç»ä»¶ç工使¹å¼å `type` 屿§çå¼èå¼ï¼æ¯å¦ `<text>`ï¼Â `password`ï¼`url`ï¼`email`ï¼`tel` çã +Weex å ç½®ç `<input>` ç»ä»¶ç¨æ¥åå»ºæ¥æ¶ç¨æ·è¾å ¥å符çè¾å ¥ç»ä»¶ã `<input>` ç»ä»¶ç工使¹å¼å `type` 屿§çå¼èå¼ï¼æ¯å¦ `text`ï¼Â `password`ï¼`url`ï¼`email`ï¼`tel` çã **注æï¼** -æ¤ç»ä»¶ä¸æ¯æÂ `click` äºä»¶ã请çå¬ `<input>` æÂ `change` æ¥ä»£æ¿ `click` äºä»¶ã +æ¤ç»ä»¶ä¸æ¯æÂ `click` äºä»¶ã请çå¬ `input` æÂ `change` æ¥ä»£æ¿ `click` äºä»¶ã ## åç»ä»¶ @@ -20,13 +20,18 @@ Weex å ç½®ç `<input>` ç»ä»¶ç¨æ¥åå»ºæ¥æ¶ç¨æ·è¾å ¥å符çè¾å ¥ç» ## ç¹æ§ -- `type {string}`ï¼æ§ä»¶çç±»åï¼é»è®¤å¼æ¯Â `<text>`ã`type` å¼å¯ä»¥æ¯ `text`ï¼`password`ï¼`url`ï¼`email`ï¼`tel` ï¼`number`Â ãæ¯ä¸ª `type` å¼é½ç¬¦å W3C æ åã -- `value {string}`ï¼ç»ä»¶çæ¥æ¶å°çè¾å ¥å符ã +- `type {string}`ï¼æ§ä»¶çç±»åï¼é»è®¤å¼æ¯Â `<text>`ã`type` å¼å¯ä»¥æ¯ `text`ï¼`date`ï¼`datetime`ï¼`email`ï¼Â `password`ï¼`tel`ï¼`time`ï¼`url`ï¼`number`Â ãæ¯ä¸ª `type` å¼é½ç¬¦å W3C æ åã +- `value {string}`ï¼ç»ä»¶çé»è®¤å 容ã - `placeholder {string}`ï¼æç¤ºç¨æ·å¯ä»¥è¾å ¥ä»ä¹ã æç¤ºææ¬ä¸è½æåè½¦ææ¢è¡ã - `disabled {boolean}`ï¼å¸å°ç±»åçæ°æ®ï¼è¡¨ç¤ºæ¯å¦æ¯æè¾å ¥ãé常 `click` äºä»¶å¨ `disabled` æ§ä»¶ä¸æ¯å¤±æçã - `autofocus {boolean}`ï¼å¸å°ç±»åçæ°æ®ï¼è¡¨ç¤ºæ¯å¦å¨é¡µé¢å è½½æ¶æ§ä»¶èªå¨è·å¾è¾å ¥ç¦ç¹ã - `maxlength {nubmer}`ï¼<sup class="wx-v">v0.7</sup>ä¸ä¸ªæ°å¼ç±»åçå¼ï¼è¡¨ç¤ºè¾å ¥çæå¤§é¿åº¦ã - `return-key-type {string}`ï¼<sup class="wx-v">v0.11</sup>é®çè¿åé®çç±»å,æ¯æ defalut;go;next;search;send,doneã +- `singleline {boolean}`ï¼æ§å¶å 容æ¯å¦åªå 许åè¡ +- `max-length {number}`ï¼æ§å¶è¾å ¥å 容çæå¤§é¿åº¦ +- `lines`ï¼æ§å¶è¾å ¥å 容çæå¤§è¡æ° +- `max`ï¼æ§å¶å½`type`屿§ä¸º`date`æ¶éæ©æ¥æçæå¤§æ¶é´ï¼æ ¼å¼ä¸º`yyyy-MM-dd` +- `min`ï¼æ§å¶å½`type`屿§ä¸º`date`æ¶éæ©æ¥æçæå°æ¶é´ï¼æ ¼å¼ä¸º`yyyy-MM-dd` ## æ ·å¼ http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/19aa2e91/source/references/components/input.md ---------------------------------------------------------------------- diff --git a/source/references/components/input.md b/source/references/components/input.md index c3d9967..a618ba4 100644 --- a/source/references/components/input.md +++ b/source/references/components/input.md @@ -14,13 +14,13 @@ The weex builtin component `input` is used to create input controls to receive ## Child Components -This component supports no child components. +This component does not support any child component. ## Attributes -* `type`: the type of controls to display. The default value is `text`, if this attribute is not specified. Possible values are `text`, `password`, `tel`, `email`, `url` , `number` etc. each of which has the same meaning with W3C standard. +* `type`: the type of controls to display. The default value is `text`, if this attribute is not specified. Possible values are `text`, `date`, `datetime`, `email`, `password`, `tel`, `time`, `url`, `number`. each of which has the same meaning with W3C standard. -* `value`: the value(text) of the control. +* `value`: the default value(text) of the control. * `placeholder`: a hint to the user of which can be entered to the control. The placeholder text must have no carriage returns or line-feeds. @@ -28,9 +28,19 @@ This component supports no child components. * `autofocus`: a boolean attribute lets you specify that a form control should have input focus when the page loads. +* `singleline`: a boolean sttribute sets the properties of this field (lines, horizontally scrolling, transformation method) to be for a single-line input. + +* `lines`: makes the input exactly this many lines tall. + +* `max-length`: constrain edits not to make the length of the text greater than the specified length. + +* `max` constrain the max date when `type` is `date`, format is `yyyy-MM-dd` + +* `min` constrain the min date when `type` is `date`, format is `yyyy-MM-dd` + * `maxlength`: <span class="api-version">v0.7+</span> a number value to specify maxlength of input. -* `return-key-type {string}`ï¼<sup class="wx-v">v0.11</sup>the keybord returen key type support defalut;go;next;search;send,done. +* `return-key-type`ï¼<sup class="wx-v">v0.11</sup>the keybord returen key type support `defalut`, `go`, `next`, `search`, `send`, `done`. ## Styles @@ -45,27 +55,27 @@ This component supports no child components. * text styles: checkout [text styles](../text-style.html) - * support 'color' style. - * support 'font-size' style. - * support 'font-style' style. - * support 'font-weight' style. - * support 'text-align' style. + * support `color` style. + * support `font-size` style. + * support `font-style` style. + * support `font-weight` style. + * support `text-align` style. ### common styles check out [common styles for components](../common-style.html) * support flexbox related styles. * support box model related styles. -* support 'position' related styles. -* support 'opacity', 'background-color' etc. +* support `position` related styles. +* support `opacity`, `background-color` etc. ## Events -* input: the value of an input character changes. -* change: the change event is fired when a change to the component's value is commited by the user. It always come after a 'blur' event. -* focus: a component has received focus. -* blur: a component has lost focus. -* `return`:the return key click. +* `input`: the input evenr is fired when input content changes. +* `change`: the change event is fired when a change to the component's value is commited by the user. It always come after a `blur` event. +* `focus`: a component has received focus. +* `blur`: a component has lost focus. +* `return`: the return key clicked. the object property of event: @@ -75,7 +85,7 @@ check out [common styles for components](../common-style.html) ### common events check out [common events](../common-event.html) -* support 'appear' / 'disappear' event. +* support `appear` / `disappear` event. ### Methoads @@ -98,12 +108,15 @@ check out [common events](../common-event.html) - `selectionEnd {number}`: get end location text selection range ### Notes -does not support the common-event 'click'. Please listen to the 'input' or 'change' event instead. +input does not support the common-event `click`. Please listen to the `input` or `change` event instead. ### Parameters of events' object -* for 'input' and 'change' events:'value': the value of the component who dispatched this event.'timestamp': the time stamp of the event. -* for 'focus' and 'blur' events:'timestamp': the time stamp of the event. +* for `input` and `change` events: + - `value`: the value of the component who dispatched this event. + - `timestamp`: the time stamp of the event. +* for `focus` and `blur` events: + - `timestamp`: the time stamp of the event. ## Example
