const MenuItem = {
props: {
icon:{
type:String
},
level:{
type:Number,
default:0
},
mode:{
type:String
},
hasTitle:{
type: Boolean,
}
},
methods:{
handleClick(evt){
this.$emit('click',evt);
}
},
render(h) {
const {...props} = this.$props;
const icon = props.icon;
const hasTitle = props.hasTitle
const level = props.level
const itemProps={
props:{
level:level
},
attrs:{
title:this.$slots.default[0].text
},
on:{
click:this.handleClick
},
class:{
['pl-Smenus-item']:1,
['pl-Smenus-wordwrap']:window.__sysConfig.isMenuWordwrap
},
}
return (
<li {...itemProps} >
<a class="title" >
{icon&&((icon.indexOf(".png")==-1&&icon.indexOf(".jpg")==-1)?(<i class={"icon iconfont "+icon}></i>):(<img src={window.HIVUI_SETTING.review+"?relativePath="+icon} width="20" height="20"/>))}
<span v-show={hasTitle || (!hasTitle && level > 0)} class="txt">{this.$slots.default}</span>
</a>
</li>
)
}
}
export default MenuItem;