Add badge for displating open reports count

This commit is contained in:
Angelina Filippova 2020-07-14 18:56:59 +03:00
parent 08bd5dae40
commit 49df2deb31

View file

@ -1,7 +1,14 @@
<template>
<span>
<svg-icon :icon-class="icon"/>
<span slot="title">{{ title }}</span>
<el-badge :value="count" type="primary" class="count-badge" />
</span>
</template>
<script>
export default {
name: 'MenuItem',
functional: true,
name: 'Item',
props: {
count: {
type: String,
@ -15,23 +22,13 @@ export default {
type: String,
default: ''
}
},
render(h, context) {
const { count, icon, title } = context.props
const vnodes = []
if (icon) {
vnodes.push(<svg-icon icon-class={icon}/>)
}
if (title) {
vnodes.push(<span slot='title'>{(title)} </span>)
}
if (count) {
vnodes.push(<span slot='title'>({(count)})</span>)
}
return vnodes
}
}
</script>
<style rel='stylesheet/scss' lang='scss' scoped>
.count-badge {
margin-left: 5px;
height: 48px;
}
</style>