fix: add info prop deprecation warning (#7352)
This commit is contained in:
@@ -19,6 +19,7 @@ export default createComponent({
|
||||
dot: Boolean,
|
||||
icon: String,
|
||||
name: [Number, String],
|
||||
// @deprecated
|
||||
info: [Number, String],
|
||||
badge: [Number, String],
|
||||
iconPrefix: String,
|
||||
@@ -67,6 +68,12 @@ export default createComponent({
|
||||
const active = this.parent.route ? this.routeActive : this.active;
|
||||
const color = this.parent[active ? 'activeColor' : 'inactiveColor'];
|
||||
|
||||
if (process.env.NODE_ENV !== 'production' && this.info) {
|
||||
console.warn(
|
||||
'[Vant] TabbarItem: "info" prop is deprecated, use "badge" prop instead.'
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div class={bem({ active })} style={{ color }} onClick={this.onClick}>
|
||||
<div class={bem('icon')}>
|
||||
|
||||
Reference in New Issue
Block a user