mirror of
https://github.com/wassname/slider.git
synced 2026-09-09 11:35:22 +08:00
deps: remove object-assign
This commit is contained in:
@@ -51,7 +51,6 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"classnames": "^2.2.1",
|
||||
"object-assign": "^4.0.1",
|
||||
"rc-tooltip": "3.x",
|
||||
"rc-util": "3.x"
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,7 +1,6 @@
|
||||
import React from 'react';
|
||||
import {Dom as DomUtils} from 'rc-util';
|
||||
import classNames from 'classnames';
|
||||
import objectAssign from 'object-assign';
|
||||
import Track from './Track';
|
||||
import Handle from './Handle';
|
||||
import Steps from './Steps';
|
||||
@@ -108,7 +107,7 @@ class Slider extends React.Component {
|
||||
this.setState({handle: state.handle});
|
||||
}
|
||||
|
||||
const data = objectAssign({}, this.state, state);
|
||||
const data = {...this.state, ...state};
|
||||
const changedValue = props.range ? [data.lowerBound, data.upperBound] : data.upperBound;
|
||||
props.onChange(changedValue);
|
||||
}
|
||||
@@ -257,7 +256,7 @@ class Slider extends React.Component {
|
||||
trimAlignValue(v, nextProps) {
|
||||
const state = this.state || {};
|
||||
const {handle, lowerBound, upperBound} = state;
|
||||
const {marks, step, min, max, allowCross} = objectAssign({}, this.props, nextProps || {});
|
||||
const {marks, step, min, max, allowCross} = {...this.props, ...(nextProps || {})};
|
||||
|
||||
let val = v;
|
||||
if (val <= min) {
|
||||
|
||||
Reference in New Issue
Block a user