[Improvement] Icon: add class-prefix (#1688)

This commit is contained in:
neverland
2018-08-24 20:23:07 +08:00
committed by GitHub
parent 8052125d00
commit 873a2438b0
3 changed files with 8 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
<template>
<i :class="[b(), `van-icon-${name}`]" :style="style" v-on="$listeners">
<i :class="[classPrefix, `${classPrefix}-${name}`]" :style="style" v-on="$listeners">
<slot />
<div v-if="isDef(info)" :class="b('info')">{{ info }}</div>
</i>
@@ -15,7 +15,11 @@ export default create({
name: String,
info: [String, Number],
color: String,
size: String
size: String,
classPrefix: {
type: String,
default: 'van-icon'
}
},
computed: {