Skip to content

Commit

Permalink
feat: breadcrumb
Browse files Browse the repository at this point in the history
  • Loading branch information
JasKang committed Jul 6, 2023
1 parent 4bb38da commit 4564cec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion docs/components/breadcrumb.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Breadcrumb

```vue preview
<script setup lang="tsx">
const home = () => <HomeIcon class="h-3 w-3" />
</script>
<template>
<TBreadcrumb :items="[{ title: 'sdfs' }, { title: 'sdfs' }, { title: 'asdfasdf' }]"></TBreadcrumb>
<TBreadcrumb :items="[{ title: home }, { title: 'sdfs' }, { title: 'asdfasdf' }]"></TBreadcrumb>
</template>
```
2 changes: 1 addition & 1 deletion src/components/Breadcrumb/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const Breadcrumb = defineComponent({
<ol class="flex min-w-0 whitespace-nowrap px-2 text-sm">
{parentPaths.value.map(item => (
<li class="flex items-center">
<a class={['text-gray-400 hover:text-gray-500', item.path ? 'cursor-pointer' : '']} href={item.path}>
<a class={['text-gray-400', item.path ? 'cursor-pointer hover:text-gray-500' : '']} href={item.path}>
{typeof item.title === 'function' ? item.title() : item.title}
</a>
<ChevronRightIcon class="mx-1 h-3 w-3 flex-shrink-0 text-gray-400" aria-hidden="true" />
Expand Down

0 comments on commit 4564cec

Please sign in to comment.