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.
34 lines
882 B
34 lines
882 B
7 years ago
|
<script>
|
||
|
import PropTypes from '../_util/vue-types'
|
||
|
|
||
|
export default {
|
||
|
name: 'BreadcrumbItem',
|
||
|
inject: ['breadCrumbParent'],
|
||
|
props: {
|
||
|
prefixCls: PropTypes.string.def('ant-breadcrumb'),
|
||
|
href: PropTypes.string,
|
||
|
},
|
||
|
render () {
|
||
|
const { prefixCls, href, ...restProps } = this
|
||
|
const { breadCrumbParent = {}} = this
|
||
|
const { separator = '/' } = breadCrumbParent
|
||
|
const solt = this.$slots.default
|
||
|
let link
|
||
|
if (href !== undefined) {
|
||
|
link = <a class={`${prefixCls}-link`} {...restProps}>{solt}</a>
|
||
|
} else {
|
||
|
link = <span class={`${prefixCls}-link`} {...restProps}>{solt}</span>
|
||
|
}
|
||
|
if (solt) {
|
||
|
return (
|
||
|
<span>
|
||
|
{link}
|
||
|
<span class={`${prefixCls}-separator`}>{separator}</span>
|
||
|
</span>
|
||
|
)
|
||
|
}
|
||
|
return null
|
||
|
},
|
||
|
}
|
||
|
</script>
|