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.
ant-design-vue/components/breadcrumb/BreadcrumbItem.vue

34 lines
897 B

7 years ago
<script>
import PropTypes from '../_util/vue-types'
import { hasProp, getComponentFromProp } from '../_util/props-util'
7 years ago
export default {
name: 'BreadcrumbItem',
__ANT_BREADCRUMB_ITEM: true,
7 years ago
props: {
prefixCls: PropTypes.string.def('ant-breadcrumb'),
href: PropTypes.string,
separator: PropTypes.any,
7 years ago
},
render () {
const { prefixCls, $slots } = this
const children = $slots.default
7 years ago
let link
7 years ago
if (hasProp(this, 'href')) {
link = <a class={`${prefixCls}-link`}>{children}</a>
7 years ago
} else {
link = <span class={`${prefixCls}-link`}>{children}</span>
7 years ago
}
if (children) {
7 years ago
return (
<span>
{link}
<span class={`${prefixCls}-separator`}>{getComponentFromProp(this, 'separator') || '/'}</span>
7 years ago
</span>
)
}
return null
},
}
</script>