mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 11:10:01 +08:00
update badge anim
This commit is contained in:
parent
de13164330
commit
75d2d21b0b
@ -18,11 +18,11 @@ const Test = React.createClass({
|
||||
};
|
||||
},
|
||||
increase() {
|
||||
const count = this.state.count + 117;
|
||||
const count = this.state.count + 114;
|
||||
this.setState({ count });
|
||||
},
|
||||
decline() {
|
||||
let count = this.state.count - 111;
|
||||
let count = this.state.count - 121;
|
||||
if (count < 0) {
|
||||
count = 0;
|
||||
}
|
||||
@ -40,7 +40,6 @@ const Test = React.createClass({
|
||||
});
|
||||
},
|
||||
render() {
|
||||
console.log(this.state.count)
|
||||
return <div>
|
||||
<Badge count={this.state.count}>
|
||||
<a href="#" className="head-example"></a>
|
||||
|
@ -11,7 +11,7 @@ class AntBadge extends React.Component {
|
||||
let { count, prefixCls } = this.props;
|
||||
const dot = this.props.dot;
|
||||
|
||||
count = count >= 100 ? '99+' : count;
|
||||
//count = count >= 100 ? '99+' : count;
|
||||
|
||||
// dot mode don't need count
|
||||
if (dot) {
|
||||
|
@ -37,11 +37,14 @@ export function getTranslateY(count, preCount, data, preData, j, height, _length
|
||||
if (count > preCount) {
|
||||
if (on > to) {
|
||||
translateY = -(oneData - (to - on)) * height;
|
||||
data[(_length - j) + '_add'] = true;
|
||||
if (typeof preOn === 'number') {
|
||||
data[(_length - j) + '_add'] = true;
|
||||
}
|
||||
} else if (on < to) {
|
||||
translateY = -(oneData + 10 - (to - on)) * height;
|
||||
if (preTo - preOn) {
|
||||
translateY = -(oneData - (to - on)) * height;
|
||||
//translateY = -(oneData + 20 - (to - on)) * height;
|
||||
data[(_length - j) + '_add'] = true;
|
||||
}
|
||||
} else {
|
||||
if (typeof preOn === 'number' && typeof preTo === 'number') {
|
||||
@ -51,7 +54,9 @@ export function getTranslateY(count, preCount, data, preData, j, height, _length
|
||||
} else if (count < preCount) {
|
||||
if (on < to) {
|
||||
translateY = -(oneData + 20 - ( to - on)) * height;
|
||||
data[(_length - j) + '_rem'] = true;
|
||||
if (typeof preTo === 'number') {
|
||||
data[(_length - j) + '_rem'] = true;
|
||||
}
|
||||
} else if (on > to) {
|
||||
translateY = -(oneData + 10 - (to - on)) * height;
|
||||
if (preOn - preTo) {
|
||||
|
Loading…
Reference in New Issue
Block a user