feat[Menu]: menu icon support el-icon

This commit is contained in:
Cat73
2020-06-11 13:57:41 +08:00
committed by 花裤衩
parent 6831120a83
commit e001dab7e0
3 changed files with 32 additions and 3 deletions

View File

@@ -17,7 +17,11 @@ export default {
const vnodes = []
if (icon) {
vnodes.push(<svg-icon icon-class={icon}/>)
if (icon.includes('el-icon')) {
vnodes.push(<i class={[icon, 'sub-el-icon']} />)
} else {
vnodes.push(<svg-icon icon-class={icon}/>)
}
}
if (title) {
@@ -27,3 +31,11 @@ export default {
}
}
</script>
<style scoped>
.sub-el-icon {
color: currentColor;
width: 1em;
height: 1em;
}
</style>