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
@@ -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')}>