greenPro/unpackage/dist/dev/mp-weixin/wxcomponents/vant/icon/index.js

40 lines
874 B
JavaScript
Raw Permalink Normal View History

2024-06-02 14:51:29 +00:00
import { VantComponent } from '../common/component';
import { addUnit } from '../common/utils';
VantComponent({
props: {
dot: Boolean,
info: null,
size: {
type: null,
observer: 'setSizeWithUnit'
},
color: String,
customStyle: String,
classPrefix: {
type: String,
value: 'van-icon'
},
name: {
type: String,
observer(val) {
this.setData({
isImageName: val.indexOf('/') !== -1
});
}
}
},
data: {
sizeWithUnit: null,
},
methods: {
onClick() {
this.$emit('click');
},
setSizeWithUnit(size) {
this.setData({
sizeWithUnit: addUnit(size)
});
}
}
});