mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-17 11:11:25 +00:00
test: add TS types
This commit is contained in:
parent
302e82d6a2
commit
eed617433b
126 changed files with 3378 additions and 226 deletions
26
tests/Breadcrumbs.test.svelte
Normal file
26
tests/Breadcrumbs.test.svelte
Normal file
|
@ -0,0 +1,26 @@
|
|||
<script lang="ts">
|
||||
type Items = { href?: string; text: string }[];
|
||||
|
||||
export let items: Items = [
|
||||
{ href: "/", text: "Dashboard" },
|
||||
{ href: "/reports", text: "Annual reports" },
|
||||
{ href: "/reports/2019", text: "2019" },
|
||||
];
|
||||
|
||||
import { Row, Column, Breadcrumb, BreadcrumbItem } from "../types";
|
||||
</script>
|
||||
|
||||
<Row>
|
||||
<Column>
|
||||
<Breadcrumb>
|
||||
{#each items as item, i}
|
||||
<BreadcrumbItem
|
||||
href="{item.href}"
|
||||
isCurrentPage="{i === items.length - 1}"
|
||||
>
|
||||
{item.text}
|
||||
</BreadcrumbItem>
|
||||
{/each}
|
||||
</Breadcrumb>
|
||||
</Column>
|
||||
</Row>
|
Loading…
Add table
Add a link
Reference in a new issue