Skip to content

Commit

Permalink
fix(breadcrumb-item): correctly set domProps when no children provided
Browse files Browse the repository at this point in the history
  • Loading branch information
pooya parsa committed Feb 11, 2019
1 parent 8b086a9 commit 523e3a2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/components/breadcrumb/breadcrumb-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { mergeData } from 'vue-functional-data-merge'
import pluckProps from '../../utils/pluck-props'
import { assign } from '../../utils/object'
import BLink, { propsFactory as linkPropsFactory } from '../link/link'
import { htmlOrText } from '../../utils/html'

export const props = assign(linkPropsFactory(), {
text: {
Expand Down Expand Up @@ -41,10 +42,10 @@ export default {
componentData.attrs = { href: suppliedProps.href }
}

return h(
tag,
mergeData(data, componentData),
children || suppliedProps.html || suppliedProps.text
)
if (!children) {
componentData.domProps = htmlOrText(suppliedProps.html, suppliedProps.text)
}

return h(tag, mergeData(data, componentData), children)
}
}

0 comments on commit 523e3a2

Please sign in to comment.