You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
800 B

2 years ago
<script>
export default {
props: {
icon: String
},
render(h) {
if (this.icon) {
if (this.icon.includes('el-icon')) {
return <i class={[this.icon, 'sub-el-icon']} />
}
else if(this.icon.includes("iviewicon")){
let icon = this.icon.split("/")[1];
return <Icon type={icon} class='sub-el-icon' size="18" />
}
else if(this.icon.includes("iconfont")){
let icon = this.icon.split("/")[1]+" iconfont";
return <Icon custom={icon} class='sub-el-icon' size="18" />
}
else {
return <svg-icon class-name="sub-el-icon" icon-class={this.icon}/>
}
}
},
data() {
return {}
},
methods: {},
computed: {}
}
</script>
<style scoped lang="scss">
.sub-el-icon {
margin-right: 4px;
}
</style>