fix(icon): fix display exception in classPrefix (#5320)

This commit is contained in:
landluck 2023-04-10 10:52:55 +08:00 committed by GitHub
parent 9c5c8ce9f0
commit 588ba18b75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 4 deletions

View File

@ -2,6 +2,7 @@
@import '@vant/icons/src/index.less'; @import '@vant/icons/src/index.less';
:host { :host {
position: relative;
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

View File

@ -13,10 +13,6 @@ function rootClass(data) {
classes.push(data.classPrefix); classes.push(data.classPrefix);
} }
if (data.classPrefix !== 'van-icon') {
classes.push('van-icon')
}
if (isImage(data.name)) { if (isImage(data.name)) {
classes.push('van-icon--image'); classes.push('van-icon--image');
} else if (data.classPrefix != null) { } else if (data.classPrefix != null) {