fix: add info prop deprecation warning (#7352)
This commit is contained in:
@@ -11,6 +11,7 @@ export default createComponent({
|
||||
...routeProps,
|
||||
dot: Boolean,
|
||||
name: [Number, String],
|
||||
// @deprecated
|
||||
info: [Number, String],
|
||||
badge: [Number, String],
|
||||
title: String,
|
||||
@@ -57,6 +58,12 @@ export default createComponent({
|
||||
const { slots, parent, isActive } = this;
|
||||
const slotContent = slots();
|
||||
|
||||
if (process.env.NODE_ENV !== 'production' && this.info) {
|
||||
console.warn(
|
||||
'[Vant] Tab: "info" prop is deprecated, use "badge" prop instead.'
|
||||
);
|
||||
}
|
||||
|
||||
if (!slotContent) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user