feat[Menu]: menu icon support el-icon

This commit is contained in:
花裤衩
2020-06-15 17:11:28 +08:00
parent 5c87772025
commit e2fd7c7528
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>