mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
test(data-table): update test
This commit is contained in:
parent
df1d40257d
commit
d6704ec2b5
1 changed files with 4 additions and 4 deletions
|
@ -10,16 +10,15 @@
|
|||
Button,
|
||||
Link,
|
||||
} from "carbon-components-svelte";
|
||||
import type { DataTableHeader } from "carbon-components-svelte/DataTable/DataTable.svelte";
|
||||
import Launch from "carbon-icons-svelte/lib/Launch.svelte";
|
||||
import type { ComponentProps } from "svelte";
|
||||
|
||||
const headers: DataTableHeader[] = [
|
||||
const headers = [
|
||||
{ key: "name", value: "Name" },
|
||||
{ key: "protocol", value: "Protocol", width: "400px", minWidth: "40%" },
|
||||
{ key: "port", value: "Port" },
|
||||
{ key: "rule", value: "Rule", sort: false },
|
||||
];
|
||||
] as const;
|
||||
const rows = [
|
||||
{
|
||||
id: "a",
|
||||
|
@ -312,6 +311,7 @@
|
|||
key: 'port',
|
||||
value: 'Port',
|
||||
display: (value, row) => {
|
||||
console.log(row.port);
|
||||
return value + ' €';
|
||||
},
|
||||
sort: (a, b) => {
|
||||
|
@ -340,7 +340,7 @@
|
|||
}}"
|
||||
on:click="{(e) => {
|
||||
e.detail.cell;
|
||||
e.detail.row.name;
|
||||
e.detail.row?.name;
|
||||
}}"
|
||||
on:click:row--expand="{(e) => {
|
||||
const detail = e.detail;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue