Skip to content

Commit

Permalink
improve input, textarea demo
Browse files Browse the repository at this point in the history
  • Loading branch information
warmhug committed Nov 4, 2016
1 parent 7e1c63a commit dddf4ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/input-item/demo/basic.md
Expand Up @@ -21,6 +21,7 @@ let BasicInputExample = React.createClass({
{...getFieldProps('control')}
placeholder="设置value,不设置defaultValue"
>受控</InputItem>

<InputItem
{...getFieldProps('inputclear')}
clear
Expand All @@ -33,6 +34,7 @@ let BasicInputExample = React.createClass({
error
onErrorClick={() => { alert('点击报错'); }}
>报错样式</InputItem>

<InputItem
{...getFieldProps('input3')}
placeholder="无 label"
Expand All @@ -43,11 +45,13 @@ let BasicInputExample = React.createClass({
>
<div style={{ backgroundImage: 'url(https://os.alipayobjects.com/rmsportal/zumwvwrngNMGSWe.png)', backgroundSize: 'cover', height: '0.44rem', width: '0.44rem' }} />
</InputItem>

<InputItem
{...getFieldProps('label8')}
placeholder="限制标题显示的长度"
labelNumber={3}
>标题过长</InputItem>

<InputItem
{...getFieldProps('preice')}
placeholder="0.00"
Expand All @@ -57,6 +61,7 @@ let BasicInputExample = React.createClass({
{...getFieldProps('upload')}
extra={<img src="https://os.alipayobjects.com/rmsportal/mOoPurdIfmcuqtr.png" />}
>上传照片</InputItem>

<InputItem
{...getFieldProps('bankCard', {
initialValue: '8888 8888 8888 8888',
Expand All @@ -78,6 +83,7 @@ let BasicInputExample = React.createClass({
type="number"
placeholder="点击会弹出数字键盘"
>数字键盘</InputItem>

<InputItem
value="不可编辑"
editable={false}
Expand Down
5 changes: 5 additions & 0 deletions components/textarea-item/demo/basic.md
Expand Up @@ -22,12 +22,14 @@ let TextareaItemExample = React.createClass({
title="受控"
placeholder="设置value,不设置defaultValue"
/>

<TextareaItem
{...getFieldProps('clear1')}
clear
title="清除按钮"
placeholder="提供清除文字功能"
/>

<TextareaItem
{...getFieldProps('note8', {
initialValue: '报错样式',
Expand All @@ -38,6 +40,7 @@ let TextareaItemExample = React.createClass({
onErrorClick={() => { alert('点击报错'); }}
count={100}
/>

<TextareaItem
{...getFieldProps('note2')}
title="单行显示"
Expand All @@ -55,6 +58,7 @@ let TextareaItemExample = React.createClass({
rows={5}
count={100}
/>

<TextareaItem
{...getFieldProps('note3')}
title="高度自适应"
Expand All @@ -71,6 +75,7 @@ let TextareaItemExample = React.createClass({
title={<img src="https://os.alipayobjects.com/rmsportal/mOoPurdIfmcuqtr.png" style={{ width: '0.56rem', height: '0.56rem' }} />}
placeholder="标题可以自定义"
/>

<TextareaItem
{...getFieldProps('note6', {
initialValue: '不可编辑',
Expand Down

0 comments on commit dddf4ea

Please sign in to comment.