chore: add warning for invalid usage, close: #91

This commit is contained in:
Benjy Cui
2016-04-27 12:07:20 +08:00
parent 0e6fed5c9b
commit 0b1a421a71
2 changed files with 5 additions and 2 deletions
+3 -2
View File
@@ -52,6 +52,7 @@
"dependencies": {
"classnames": "^2.2.1",
"rc-tooltip": "3.x",
"rc-util": "3.x"
"rc-util": "3.x",
"warning": "^2.1.0"
}
}
}
+2
View File
@@ -1,7 +1,9 @@
import React from 'react';
import classNames from 'classnames';
import warning from 'warning';
function calcPoints(vertical, marks, dots, step, min, max) {
warning(dots ? step : true, '`Slider[step]` should be a positive number in order to make Slider[dots] work.');
const points = Object.keys(marks).map(parseFloat);
if (dots) {
for (let i = min; i <= max; i = i + step) {