Skip to content

Commit

Permalink
fix(breadcrumb): use querySelectorAll to get all breadcrumbs in stories
Browse files Browse the repository at this point in the history
  • Loading branch information
denilsonrp committed Jul 18, 2023
1 parent 89357e2 commit eaa3a39
Showing 1 changed file with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,26 @@ const createBreadcrumb = () => {
<script>
;(function () {
const atomBreadcrumb = document.querySelector('atom-breadcrumb')
const breadcrumbsElements = document.querySelectorAll('atom-breadcrumb')
atomBreadcrumb.items = [
{
text: 'First level',
title: 'Go to first level',
redirect: () => console.log('/first'),
},
{
text: 'Intermediary level',
title: 'Go to intermediary level',
redirect: () => console.log('/intermediary'),
},
{
text: 'Current level',
title: 'This is the current level',
},
]
breadcrumbsElements.forEach((atomBreadcrumb) => {
atomBreadcrumb.items = [
{
text: 'First level',
title: 'Go to first level',
redirect: () => console.log('/first'),
},
{
text: 'Intermediary level',
title: 'Go to intermediary level',
redirect: () => console.log('/intermediary'),
},
{
text: 'Current level',
title: 'This is the current level',
},
]
})
})()
</script>
`
Expand Down

0 comments on commit eaa3a39

Please sign in to comment.