mirror of
https://github.com/wassname/slider.git
synced 2026-09-09 11:35:22 +08:00
chore: add warning for invalid usage, close: #91
This commit is contained in:
+3
-2
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user