diff --git a/packages/icon/index.ts b/packages/icon/index.ts index c73f6e73..77586ccf 100644 --- a/packages/icon/index.ts +++ b/packages/icon/index.ts @@ -3,13 +3,20 @@ import { VantComponent } from '../common/component'; VantComponent({ props: { info: null, - name: String, size: String, color: String, customStyle: String, classPrefix: { type: String, value: 'van-icon' + }, + name: { + type: String, + observer(val) { + this.setData({ + isImageName: val.indexOf('/') !== -1 + }); + } } }, diff --git a/packages/icon/index.wxml b/packages/icon/index.wxml index 3c1bbad0..4b961fcc 100644 --- a/packages/icon/index.wxml +++ b/packages/icon/index.wxml @@ -1,7 +1,5 @@ - - @@ -11,7 +9,7 @@ custom-class="van-icon__info" />