Pre Merge pull request !446 from 十一月的肖邦/Sidebar
This commit is contained in:
commit
16721a4abd
@ -1,29 +1,39 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'MenuItem',
|
name: 'MenuItem',
|
||||||
functional: true,
|
functional: true,
|
||||||
props: {
|
props: {
|
||||||
icon: {
|
icon: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
render(h, context) {
|
render(h, context) {
|
||||||
const { icon, title } = context.props
|
const { icon, title } = context.props
|
||||||
const vnodes = []
|
const vnodes = []
|
||||||
|
|
||||||
if (icon) {
|
if (icon) {
|
||||||
vnodes.push(<svg-icon icon-class={icon}/>)
|
vnodes.push(<svg-icon icon-class={icon}/>)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (title) {
|
if (title) {
|
||||||
vnodes.push(<span slot='title'>{(title)}</span>)
|
if (title.length > 5) {
|
||||||
}
|
vnodes.push(
|
||||||
return vnodes
|
<el-tooltip slot="title" className="item" effect="dark" content={title} placement="right">
|
||||||
}
|
<span>{(title)}</span>
|
||||||
}
|
</el-tooltip>
|
||||||
</script>
|
)
|
||||||
|
} else {
|
||||||
|
vnodes.push(
|
||||||
|
<span slot="title">{(title)}</span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return vnodes
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user