mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 14:13:37 +08:00
add slider display page
This commit is contained in:
parent
349061b711
commit
ca403d39af
16
components/slider/demo/basic.md
Normal file
16
components/slider/demo/basic.md
Normal file
@ -0,0 +1,16 @@
|
||||
# 基本
|
||||
|
||||
- order: 0
|
||||
|
||||
基本滑动条
|
||||
|
||||
---
|
||||
|
||||
````jsx
|
||||
var Slider = antd.Slider;
|
||||
|
||||
React.render(
|
||||
<Slider />
|
||||
, document.getElementById('components-slider-demo-basic'));
|
||||
````
|
||||
|
16
components/slider/demo/mark.md
Normal file
16
components/slider/demo/mark.md
Normal file
@ -0,0 +1,16 @@
|
||||
# 分段式滑块
|
||||
|
||||
- order: 3
|
||||
|
||||
使用 `marks` 属性标注分段式滑块,结合 `index` 可以指定滑块按钮初始位置。
|
||||
|
||||
---
|
||||
|
||||
````jsx
|
||||
var Slider = antd.Slider;
|
||||
|
||||
React.render(
|
||||
<Slider marks={["状态1","状态2","状态3","状态4"]} index={1}/>
|
||||
, document.getElementById('components-slider-demo-mark'));
|
||||
````
|
||||
|
@ -0,0 +1,15 @@
|
||||
var React = require('react');
|
||||
var Slider = require('rc-slider');
|
||||
|
||||
var AntSlider = React.createClass({
|
||||
getDefaultProps() {
|
||||
return {
|
||||
className: 'ant-slider'
|
||||
};
|
||||
},
|
||||
render() {
|
||||
return <Slider {...this.props}/>;
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = AntSlider;
|
@ -10,3 +10,15 @@
|
||||
## 何时使用
|
||||
|
||||
当用户需要在数值区间/自定义区间内进行选择时,输入值可为连续或离散值。
|
||||
|
||||
## API
|
||||
|
||||
| 参数 | 类型 | 默认值 |说明 |
|
||||
|------------|----------------|-------------|--------------|
|
||||
| min | Number | 0 | 最小值
|
||||
| max | Number | 100 | 最大值
|
||||
| step | Number | 1 | 步长,取值必须大于 0,并且可被 (max - min) 整除
|
||||
| value | Number | 0 | 当前取值
|
||||
| marks | Array | [] | 分段标记,标记每一个 step,如果 step 属性没有定义,则 `marks` 属性会被忽略
|
||||
| index | Number | 0 | 为具备 `step` 或者 `marks` 的 slider 提供滑块操作按钮最初的位置
|
||||
| disabled | Boolean | false | 值为 `true` 时,滑块为 disable 禁用状态
|
Loading…
Reference in New Issue
Block a user