fix: badge custom class not work
parent
72da2b8997
commit
93cb7b2f00
|
@ -4,10 +4,10 @@ const getTransitionProps = (transitionName, opt = {}) => {
|
||||||
appear: true,
|
appear: true,
|
||||||
css: false,
|
css: false,
|
||||||
onEnter: (el, done) => {
|
onEnter: (el, done) => {
|
||||||
animate(el, `${transitionName}-enter`, done);
|
transitionName ? animate(el, `${transitionName}-enter`, done) : done();
|
||||||
},
|
},
|
||||||
onLeave: (el, done) => {
|
onLeave: (el, done) => {
|
||||||
animate(el, `${transitionName}-leave`, done);
|
transitionName ? animate(el, `${transitionName}-leave`, done) : done();
|
||||||
},
|
},
|
||||||
...opt,
|
...opt,
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,6 +26,7 @@ const ScrollNumberProps = {
|
||||||
component: PropTypes.string,
|
component: PropTypes.string,
|
||||||
title: PropTypes.oneOfType([PropTypes.number, PropTypes.string, null]),
|
title: PropTypes.oneOfType([PropTypes.number, PropTypes.string, null]),
|
||||||
displayComponent: PropTypes.any,
|
displayComponent: PropTypes.any,
|
||||||
|
onAnimated: PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -65,7 +66,7 @@ export default {
|
||||||
animateStarted: false,
|
animateStarted: false,
|
||||||
sCount: count,
|
sCount: count,
|
||||||
},
|
},
|
||||||
this.onAnimated,
|
this.handleAnimated,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -102,7 +103,7 @@ export default {
|
||||||
}
|
}
|
||||||
return num;
|
return num;
|
||||||
},
|
},
|
||||||
onAnimated() {
|
handleAnimated() {
|
||||||
this.$emit('animated');
|
this.$emit('animated');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -165,11 +166,20 @@ export default {
|
||||||
const { class: className, style = {} } = this.$attrs;
|
const { class: className, style = {} } = this.$attrs;
|
||||||
if (displayComponent) {
|
if (displayComponent) {
|
||||||
return cloneElement(displayComponent, {
|
return cloneElement(displayComponent, {
|
||||||
class: `${prefixCls}-custom-component`,
|
class: classNames(
|
||||||
|
`${prefixCls}-custom-component`,
|
||||||
|
displayComponent.props && displayComponent.props.class,
|
||||||
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// fix https://fb.me/react-unknown-prop
|
// fix https://fb.me/react-unknown-prop
|
||||||
const restProps = omit(this.$props, ['count', 'component', 'prefixCls', 'displayComponent']);
|
const restProps = omit({ ...this.$props, ...this.$attrs }, [
|
||||||
|
'count',
|
||||||
|
'onAnimated',
|
||||||
|
'component',
|
||||||
|
'prefixCls',
|
||||||
|
'displayComponent',
|
||||||
|
]);
|
||||||
const tempStyle = { ...style };
|
const tempStyle = { ...style };
|
||||||
const newProps = {
|
const newProps = {
|
||||||
...restProps,
|
...restProps,
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue