-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Erindcl
committed
Mar 7, 2021
1 parent
70fb0a9
commit 46d53da
Showing
20 changed files
with
206 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
order: 1 | ||
title: | ||
zh-CN: 基本 | ||
--- | ||
|
||
## zh-CN | ||
|
||
省市区级联。 | ||
|
||
```jsx | ||
import { Cascader } from 'antd'; | ||
|
||
const options = [ | ||
{ | ||
value: 'zhejiang', | ||
label: 'Zhejiang', | ||
children: [ | ||
{ | ||
value: 'hangzhou', | ||
label: 'Hangzhou', | ||
children: [ | ||
{ | ||
value: 'xihu', | ||
label: 'West Lake', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
value: 'jiangsu', | ||
label: 'Jiangsu', | ||
children: [ | ||
{ | ||
value: 'nanjing', | ||
label: 'Nanjing', | ||
children: [ | ||
{ | ||
value: 'zhonghuamen', | ||
label: 'Zhong Hua Men', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; | ||
|
||
function onChange(value) { | ||
console.log(value); | ||
} | ||
|
||
ReactDOM.render( | ||
<Cascader options={options} onChange={onChange} placeholder="Please select" />, | ||
mountNode, | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
category: Components | ||
subtitle: 级联选择 | ||
type: 数据录入 | ||
title: Cascader | ||
cols: 2 | ||
--- | ||
|
||
级联选择框。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
order: 1 | ||
title: | ||
zh-CN: 灰色背景(仅默认主题下使用) | ||
--- | ||
|
||
## zh-CN | ||
|
||
灰色背景中的表单需添加投影,去掉外边框 | ||
|
||
仅默认主题下使用,暗黑主题下使用无效 | ||
|
||
- 为组件添加类名`dt-radio-group` | ||
|
||
```jsx | ||
import { Radio } from 'antd'; | ||
|
||
ReactDOM.render( | ||
<div className="demo-radio-shadow"> | ||
<Radio.Group className="dt-radio-group" defaultValue="a" buttonStyle="solid"> | ||
<Radio.Button value="a">Hangzhou</Radio.Button> | ||
<Radio.Button value="b">Shanghai</Radio.Button> | ||
<Radio.Button value="c">Beijing</Radio.Button> | ||
<Radio.Button value="d">Chengdu</Radio.Button> | ||
</Radio.Group> | ||
</div>, | ||
mountNode | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
category: Components | ||
subtitle: 单选框 | ||
type: 数据录入 | ||
title: Radio | ||
cols: 1 | ||
--- | ||
|
||
单选框。 | ||
|
||
## API | ||
|
||
|类名 |说明 |使用示例 | | ||
|---------|---------|---------| | ||
|.dt-radio-group | 灰色背景 | 灰色背景(仅默认主题下使用) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
order: 5 | ||
title: | ||
zh-CN: 多选 | ||
--- | ||
|
||
## zh-CN | ||
|
||
多选,从已有条目中选择。 | ||
|
||
```jsx | ||
import { Select } from 'antd'; | ||
|
||
const { Option } = Select; | ||
|
||
const children = []; | ||
for (let i = 10; i < 36; i++) { | ||
children.push(<Option key={i.toString(36) + i}>{i.toString(36) + i}</Option>); | ||
} | ||
|
||
function handleChange(value) { | ||
console.log(`selected ${value}`); | ||
} | ||
|
||
ReactDOM.render( | ||
<Select | ||
mode="multiple" | ||
style={{ width: '100%' }} | ||
placeholder="Please select" | ||
defaultValue={['a10', 'c12']} | ||
onChange={handleChange} | ||
> | ||
{children} | ||
</Select>, | ||
mountNode, | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.