mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-17 03:01:25 +00:00
docs(data-table): improve docs
This commit is contained in:
parent
86aed30789
commit
90b067ded3
2 changed files with 108 additions and 102 deletions
|
@ -8,37 +8,40 @@
|
|||
$: console.log("sortDirection", sortDirection);
|
||||
</script>
|
||||
|
||||
<Button
|
||||
kind="tertiary"
|
||||
disabled={sortKey === "port" && sortDirection === "ascending"}
|
||||
on:click={() => {
|
||||
sortKey = "port";
|
||||
sortDirection = "ascending";
|
||||
}}
|
||||
>
|
||||
Sort "port" in ascending order
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
kind="tertiary"
|
||||
disabled={sortKey === "name" && sortDirection === "descending"}
|
||||
on:click={() => {
|
||||
sortKey = "name";
|
||||
sortDirection = "descending";
|
||||
}}
|
||||
>
|
||||
Sort "name" in descending order
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
kind="ghost"
|
||||
on:click={() => {
|
||||
sortKey = null;
|
||||
sortDirection = "none";
|
||||
}}
|
||||
>
|
||||
Clear sorting
|
||||
</Button>
|
||||
<div style="margin-bottom: 1rem">
|
||||
<Button
|
||||
size="sm"
|
||||
kind="tertiary"
|
||||
disabled={sortKey === "port" && sortDirection === "ascending"}
|
||||
on:click={() => {
|
||||
sortKey = "port";
|
||||
sortDirection = "ascending";
|
||||
}}
|
||||
>
|
||||
Sort "port" in ascending order
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
kind="tertiary"
|
||||
disabled={sortKey === "name" && sortDirection === "descending"}
|
||||
on:click={() => {
|
||||
sortKey = "name";
|
||||
sortDirection = "descending";
|
||||
}}
|
||||
>
|
||||
Sort "name" in descending order
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
kind="ghost"
|
||||
on:click={() => {
|
||||
sortKey = null;
|
||||
sortDirection = "none";
|
||||
}}
|
||||
>
|
||||
Clear sorting
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<DataTable
|
||||
sortable
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue