mirror of
https://github.com/wassname/slider.git
synced 2026-09-10 12:38:09 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c28f14272d | ||
|
|
b70a4e8c94 | ||
|
|
41f5ddb9bd | ||
|
|
38edc4db93 | ||
|
|
93ddaef0c3 | ||
|
|
dbc64888bc | ||
|
|
2112385ccc |
-29
@@ -1,29 +0,0 @@
|
||||
build/
|
||||
*.cfg
|
||||
nohup.out
|
||||
*.iml
|
||||
.idea/
|
||||
.ipr
|
||||
.iws
|
||||
*~
|
||||
~*
|
||||
*.diff
|
||||
*.log
|
||||
*.patch
|
||||
*.bak
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
.project
|
||||
.*proj
|
||||
.svn/
|
||||
*.swp
|
||||
out/
|
||||
.build
|
||||
node_modules
|
||||
.cache
|
||||
examples
|
||||
tests
|
||||
src
|
||||
/index.js
|
||||
.*
|
||||
assets/**/*.less
|
||||
@@ -1,5 +1,7 @@
|
||||
language: node_js
|
||||
|
||||
sudo: false
|
||||
|
||||
notifications:
|
||||
email:
|
||||
- yiminghe@gmail.com
|
||||
|
||||
@@ -99,6 +99,12 @@ React.render(<Rcslider />, container);
|
||||
<td>number</td>
|
||||
<td>0</td>
|
||||
<td>Determines the initial positions of the handles.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>value</td>
|
||||
<td>number</td>
|
||||
<td></td>
|
||||
<td>Determines the current positions of the handles.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>marks</td>
|
||||
@@ -118,6 +124,12 @@ React.render(<Rcslider />, container);
|
||||
<td>0</td>
|
||||
<td>For step or marks slider, determine the initial positions of the handles.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>index</td>
|
||||
<td>number</td>
|
||||
<td></td>
|
||||
<td>For step or marks slider, determine current positions of the handles.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>disabled</td>
|
||||
<td>boolean</td>
|
||||
@@ -138,7 +150,7 @@ npm start
|
||||
|
||||
http://localhost:8000/examples/
|
||||
|
||||
online example: http://react-component.github.io/slider/examples/
|
||||
online example: http://react-component.github.io/slider/
|
||||
|
||||
## Test Case
|
||||
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
require('rc-slider/assets/index.css');
|
||||
require('rc-slider/assets/index.less');
|
||||
|
||||
var Slider = require('rc-slider');
|
||||
var React = require('react');
|
||||
@@ -9,6 +9,6 @@ function onChange(v){
|
||||
console.log(v);
|
||||
}
|
||||
|
||||
// React.render(<Slider marks={["一","二","三","四","五"]} index={3}/>, document.getElementById('__react-content'));
|
||||
// React.render(<Slider className='rc-slider' step={20}/>, document.getElementById('__react-content'));
|
||||
// React.render(<div style={{width:400,margin:100}}><Slider marks={["一","二","三","四","五"]} defaultIndex={2} /></div>, document.getElementById('__react-content'));
|
||||
// React.render(<div style={{width:400,margin:100}}><Slider className='rc-slider' step={20}/></div>, document.getElementById('__react-content'));
|
||||
React.render(<div style={{width:400,margin:100}}><Slider onChange={onChange}/></div>, document.getElementById('__react-content'));
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rc-slider",
|
||||
"version": "1.4.0",
|
||||
"version": "1.4.3",
|
||||
"description": "slider ui component for react",
|
||||
"keywords": [
|
||||
"react",
|
||||
|
||||
+4
-3
@@ -33,7 +33,7 @@ function getValueFromIndex(props) {
|
||||
}
|
||||
if (marksLen > 0) {
|
||||
value = ((props.max - props.min) / (marksLen - 1)) * (index);
|
||||
value = value.toFixed(5);
|
||||
value = value.toFixed(5) / 1;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ const Slider = React.createClass({
|
||||
},
|
||||
|
||||
onMouseMove(e) {
|
||||
const position = e.pageX;
|
||||
const position = e.pageX || (e.clientX + document.documentElement.scrollLeft); // to compat ie8
|
||||
this.onMove(e, position);
|
||||
},
|
||||
|
||||
@@ -162,7 +162,7 @@ const Slider = React.createClass({
|
||||
},
|
||||
|
||||
onSliderMouseDown(e) {
|
||||
const position = e.pageX;
|
||||
const position = e.pageX || (e.clientX + document.documentElement.scrollLeft); // to compat ie8
|
||||
const value = this._calValueByPos(position);
|
||||
this._triggerEvents('onChange', value);
|
||||
this._start(position);
|
||||
@@ -299,6 +299,7 @@ const Slider = React.createClass({
|
||||
tooltipVisible = true;
|
||||
} else {
|
||||
events = {
|
||||
onClick: this.showTooltip.bind(this, true),
|
||||
onMouseEnter: this.showTooltip.bind(this, true),
|
||||
onMouseLeave: this.showTooltip.bind(this, false),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user