From 510dad58bfd4a39f93cf6b7fdc3f8739adec195c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Fri, 22 Jun 2018 15:46:21 +0800 Subject: [PATCH] edit doc and dom --- components/drawer/__tests__/Drawer.test.js | 5 +- components/drawer/demo/basic.md | 5 +- components/drawer/demo/from-drawer.md | 11 +++-- components/drawer/demo/user-profile.md | 55 +++++++++++++--------- 4 files changed, 43 insertions(+), 33 deletions(-) diff --git a/components/drawer/__tests__/Drawer.test.js b/components/drawer/__tests__/Drawer.test.js index 82c56af7fd..975379af2f 100644 --- a/components/drawer/__tests__/Drawer.test.js +++ b/components/drawer/__tests__/Drawer.test.js @@ -6,10 +6,9 @@ import Drawer from '..'; class DrawerTester extends React.Component { constructor(props) { super(props); - this.state = { visible: false }; + this.state = { visible: true }; } componentDidMount() { - this.setState({ visible: true }); // eslint-disable-line react/no-did-mount-set-state } saveContainer = (container) => { this.container = container; @@ -34,7 +33,7 @@ class DrawerTester extends React.Component { } describe('Drawer', () => { - it('render correctly', () => { + fit('render correctly', () => { const wrapper = mount(); const content = wrapper.find('.ant-drawer-body').getDOMNode().innerHTML; expect(content).toBe('Here is content of Drawer'); diff --git a/components/drawer/demo/basic.md b/components/drawer/demo/basic.md index 1351ed3a58..4b78f9cabf 100644 --- a/components/drawer/demo/basic.md +++ b/components/drawer/demo/basic.md @@ -1,13 +1,13 @@ --- order: 0 title: - zh-CN: 基本 + zh-CN: 基础抽屉 en-US: Basic --- ## zh-CN -第一个抽屉。 +基础抽屉,点击触发按钮抽屉从右滑出,点击遮罩区关闭 ## en-US @@ -37,6 +37,7 @@ class App extends React.Component { diff --git a/components/drawer/demo/from-drawer.md b/components/drawer/demo/from-drawer.md index e3361c7904..53f8b69d81 100644 --- a/components/drawer/demo/from-drawer.md +++ b/components/drawer/demo/from-drawer.md @@ -1,17 +1,17 @@ --- order: 0 title: - zh-CN: 表单抽屉 - en-US: from drawer + zh-CN: 任务抽屉 + en-US: Task drawer --- ## zh-CN -展示用户的详细信息 +用于承载任务相关操作,需要点击关闭按钮关闭。 ## en-US -Display user details +sed to carry tasks related operations, need to close by clicking the close button. ```jsx import { Drawer, Form, Button, Col, Row, Input, Select, DatePicker } from 'antd'; @@ -42,6 +42,7 @@ class App extends React.Component { width={720} placement="right" onClose={this.onClose} + maskClosable={false} visible={this.state.visible} >
@@ -122,7 +123,7 @@ class App extends React.Component { - + {getFieldDecorator('description', { rules: [ { diff --git a/components/drawer/demo/user-profile.md b/components/drawer/demo/user-profile.md index 5bb64dbda5..2d23e18557 100644 --- a/components/drawer/demo/user-profile.md +++ b/components/drawer/demo/user-profile.md @@ -1,20 +1,24 @@ --- order: 0 title: - zh-CN: 用户信息 - en-US: User Profile + zh-CN: 信息预览抽屉 + en-US: Preview drawer --- ## zh-CN -展示用户的详细信息 +用于信息预览的抽屉,点击遮罩区关闭。 + +- 需要快速预览对象概要时使用。如列表条目预览。 ## en-US -Display user details +Drawer for information preview, click mask area off. + +- Use when you need to quickly preview the outline of the object. Such as list item preview. ```jsx -import { Drawer, Divider, Button, Col, Row } from 'antd'; +import { Drawer, List, Avatar, Divider, Col, Row } from 'antd'; const pStyle = { fontSize: 16, @@ -63,23 +67,28 @@ class App extends React.Component { render() { return (
- + ( + View Profile]}> + + } + title={item.name} + description="Progresser AFX" + /> + + )} + /> - Lin} /> + Lin} />