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
@@ -21,6 +21,7 @@ export default createComponent({
text: String,
icon: String,
iconPrefix: String,
// @deprecated
info: [Number, String],
badge: [Number, String],
},
@@ -73,6 +74,12 @@ export default createComponent({
const iconSlot = this.slots('icon');
const info = this.badge ?? this.info;
if (process.env.NODE_ENV !== 'production' && this.info) {
console.warn(
'[Vant] GridItem: "info" prop is deprecated, use "badge" prop instead.'
);
}
if (iconSlot) {
return (
<div class={bem('icon-wrapper')}>