mirror of
https://github.com/wassname/slider.git
synced 2026-10-28 13:30:39 +08:00
refactor: update Marks style algorithm
This commit is contained in:
1 parent
6347b6d0c6
commit
73b9953084
1 file changed
+5
-2
+5
-2
@@ -16,8 +16,11 @@ const Marks = ({className, marks, included, upperBound, lowerBound, max, min}) =
|
||||
[className + '-text-active']: isActived,
|
||||
});
|
||||
|
||||
const style = { width: markWidth + '%' };
|
||||
style.left = (point - min) / range * 100 - markWidth / 2 + '%';
|
||||
const style = {
|
||||
width: markWidth + '%',
|
||||
marginLeft: -markWidth / 2 + '%',
|
||||
};
|
||||
style.left = (point - min) / range * 100 + '%';
|
||||
|
||||
const markPoint = marks[point];
|
||||
const markPointIsObject = typeof markPoint === 'object' &&
|
||||
|
||||
Reference in new issue
Block a user