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({
props: {
...routeProps,
dot: Boolean,
// @deprecated
info: [Number, String],
badge: [Number, String],
title: String,
@@ -37,6 +38,12 @@ export default createComponent({
},
render() {
if (process.env.NODE_ENV !== 'production' && this.info) {
console.warn(
'[Vant] SidebarItem: "info" prop is deprecated, use "badge" prop instead.'
);
}
return (
<a
class={bem({ select: this.select, disabled: this.disabled })}