-
-
Notifications
You must be signed in to change notification settings - Fork 227
/
InputPage.jsx
60 lines (53 loc) · 2.02 KB
/
InputPage.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import React, { Component } from 'react';
import Container from '../components/Container';
import Header from '../components/Header';
import Footer from '../components/Footer';
import { Panel, Input, Cell } from '../../components';
class Page extends Component {
render() {
return (
<Container className="cell-page">
<Header title="文本框 Input" />
<main>
<Panel>
<Panel.Header>
<Panel.Title>普通</Panel.Title>
</Panel.Header>
<Panel.Body>
<Cell title="单行文本"><Input ref={(ele) => { this.focusInput = ele; }} type="text" placeholder="type is text" /></Cell>
<Cell title="多行文本"><Input type="textarea" rows="3" placeholder="type is textarea" /></Cell>
<Cell><a onClick={() => { this.focusInput.input.focus(); }}>click to focus the first input</a></Cell>
</Panel.Body>
</Panel>
<Panel>
<Panel.Header>
<Panel.Title>高度自适应</Panel.Title>
</Panel.Header>
<Panel.Body>
<Cell title="多行文本"><Input autosize type="textarea" rows="3" placeholder="写点啥..." /></Cell>
</Panel.Body>
</Panel>
<Panel>
<Panel.Header>
<Panel.Title>无标签栏</Panel.Title>
</Panel.Header>
<Panel.Body>
<Cell><Input type="text" placeholder="标题" /></Cell>
<Cell><Input autosize type="textarea" rows="4" maxLength="200" placeholder="摘要" /></Cell>
</Panel.Body>
</Panel>
<Panel>
<Panel.Header>
<Panel.Title>显示输入字数</Panel.Title>
</Panel.Header>
<Panel.Body>
<Cell><Input autosize showLength type="textarea" rows="4" maxLength="200" placeholder="摘要" value="111" /></Cell>
</Panel.Body>
</Panel>
</main>
<Footer />
</Container>
);
}
}
export default Page;