fix: add info prop deprecation warning (#7352)

This commit is contained in:
neverland
2020-10-16 20:52:19 +08:00
committed by GitHub
parent 3fe485c959
commit 7d0f4fc9ed
5 changed files with 35 additions and 0 deletions
+7
View File
@@ -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;
}