[bugfix] Icon: size prop not work (#1634)

This commit is contained in:
neverland 2018-08-16 09:53:56 +08:00 committed by GitHub
parent b24e21b9cb
commit 1435611262
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
<template>
<i :class="[b(), `van-icon-${name}`]" :style="{ color, size }" v-on="$listeners">
<i :class="[b(), `van-icon-${name}`]" :style="style" v-on="$listeners">
<slot />
<div v-if="isDef(info)" :class="b('info')">{{ info }}</div>
</i>
@ -16,6 +16,15 @@ export default create({
info: [String, Number],
color: String,
size: String
},
computed: {
style() {
return {
color: this.color,
fontSize: this.size
};
}
}
});
</script>