mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-05 23:46:28 +08:00
docs: update docs and demos
This commit is contained in:
parent
691d0ca606
commit
a84be2c043
@ -2,7 +2,7 @@
|
||||
|
||||
- order: 4
|
||||
|
||||
当 Slider 的值发生改变时,会触发 onChange 事件,并把改变后的值作为参数传入。
|
||||
当 Slider 的值发生改变时,会触发 `onChange` 事件,并把改变后的值作为参数传入。在 `onmouseup` 时,会触发 `onAfterChange` 事件,并把当前值作为参数传入。
|
||||
|
||||
---
|
||||
|
||||
@ -17,6 +17,7 @@ ReactDOM.render(
|
||||
<div>
|
||||
<Slider defaultValue={30} onChange={log} />
|
||||
<Slider range step={10} defaultValue={[20, 50]} onChange={log} />
|
||||
<Slider defaultValue={30} onAfterChange={log} />
|
||||
</div>
|
||||
, document.getElementById('components-slider-demo-event'));
|
||||
````
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
- order: 5
|
||||
|
||||
使用 `tipFormatter` 可以格式化 `Tooltip` 的内容。
|
||||
使用 `tipFormatter` 可以格式化 `Tooltip` 的内容,设置 `tipFormatter={null}`,则隐藏 `Tooltip`。
|
||||
|
||||
---
|
||||
|
||||
@ -13,6 +13,8 @@ function formatter(value) {
|
||||
return '$' + value;
|
||||
}
|
||||
|
||||
ReactDOM.render(<Slider tipFormatter={formatter} />
|
||||
, document.getElementById('components-slider-demo-tip-formatter'));
|
||||
ReactDOM.render(<div>
|
||||
<Slider tipFormatter={formatter} />
|
||||
<Slider tipFormatter={null} />
|
||||
</div>, document.getElementById('components-slider-demo-tip-formatter'));
|
||||
````
|
||||
|
@ -26,4 +26,5 @@
|
||||
| disabled | Boolean | false | 值为 `true` 时,滑块为禁用状态
|
||||
| allowCross | Boolean | true | 当 `range` 为 `true` 时,该属性可以设置是否允许两个滑块交换位置。
|
||||
| onChange | Function | NOOP | 当 Slider 的值发生改变时,会触发 onChange 事件,并把改变后的值作为参数传入。
|
||||
| tipFormatter | Function | | Slider 会把当前值传给 `tipFormatter`,并在 Tooltip 中显示 `tipFormatter` 的返回值。
|
||||
| onAfterChange | Function | NOOP | 与 `onmouseup` 触发时机一致,把当前值作为参数传入。
|
||||
| tipFormatter | Function or null | IDENTITY | Slider 会把当前值传给 `tipFormatter`,并在 Tooltip 中显示 `tipFormatter` 的返回值,若为 null,则隐藏 Tooltip。
|
||||
|
@ -53,13 +53,13 @@
|
||||
"rc-queue-anim": "~0.11.2",
|
||||
"rc-radio": "~2.0.0",
|
||||
"rc-select": "~5.4.0",
|
||||
"rc-slider": "~3.2.0",
|
||||
"rc-slider": "~3.3.0",
|
||||
"rc-steps": "~1.4.1",
|
||||
"rc-switch": "~1.3.1",
|
||||
"rc-table": "~3.6.2",
|
||||
"rc-tabs": "~5.5.0",
|
||||
"rc-time-picker": "1.0.0-alpha9",
|
||||
"rc-tooltip": "~3.2.0",
|
||||
"rc-tooltip": "~3.3.0",
|
||||
"rc-tree": "~0.19.0",
|
||||
"rc-trigger": "~1.0.6",
|
||||
"rc-upload": "~1.7.0",
|
||||
|
Loading…
Reference in New Issue
Block a user