From acd2899827810307d773761696b5e2812352a1b8 Mon Sep 17 00:00:00 2001 From: Erindcl Date: Thu, 20 Aug 2020 16:56:04 +0800 Subject: [PATCH] feat: cascader and datePicker --- components/form/demo/basic.md | 56 ++++++++++++++++++++++++++++++++++- theme/dt-theme/dark/form.less | 15 ++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/components/form/demo/basic.md b/components/form/demo/basic.md index 2d7ab682..3be08f60 100755 --- a/components/form/demo/basic.md +++ b/components/form/demo/basic.md @@ -14,7 +14,8 @@ title: Basic usage example. ```jsx -import { Form, Icon, Input, Button, Checkbox, InputNumber, Radio, Switch } from 'antd'; +import { Form, Icon, Input, Button, Checkbox, InputNumber, Radio, Switch, Cascader, Select } from 'antd'; +const { Option } = Select; const formItemLayout = { labelCol: { xs: { span: 24 }, @@ -37,6 +38,41 @@ class NormalLoginForm extends React.Component { render() { const { getFieldDecorator } = this.props.form; + const options = [ + { + value: 'zhejiang', + label: '浙江', + children: [ + { + value: 'hangzhou', + label: '杭州', + children: [ + { + value: 'westLake', + label: '西湖', + }, + ], + }, + ], + }, + { + value: 'jiangsu', + label: '江苏', + children: [ + { + value: 'nanjing', + label: '南京', + children: [ + { + value: 'zhongHuaMen', + label: '中华门', + }, + ], + }, + ], + }, + ]; + return (
@@ -46,6 +82,17 @@ class NormalLoginForm extends React.Component { )} + + {getFieldDecorator('role', { + rules: [{ required: true, message: 'It is required!' }], + })( + + )} + {getFieldDecorator('password', { rules: [{ required: true, message: 'It is required!' }], @@ -85,6 +132,13 @@ class NormalLoginForm extends React.Component { )} + + {getFieldDecorator('location', { + rules: [{ required: false, message: 'It is required!' }], + })( + + )} +