mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +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,
|
Button,
|
||||||
Link,
|
Link,
|
||||||
} from "carbon-components-svelte";
|
} from "carbon-components-svelte";
|
||||||
import type { DataTableHeader } from "carbon-components-svelte/DataTable/DataTable.svelte";
|
|
||||||
import Launch from "carbon-icons-svelte/lib/Launch.svelte";
|
import Launch from "carbon-icons-svelte/lib/Launch.svelte";
|
||||||
import type { ComponentProps } from "svelte";
|
import type { ComponentProps } from "svelte";
|
||||||
|
|
||||||
const headers: DataTableHeader[] = [
|
const headers = [
|
||||||
{ key: "name", value: "Name" },
|
{ key: "name", value: "Name" },
|
||||||
{ key: "protocol", value: "Protocol", width: "400px", minWidth: "40%" },
|
{ key: "protocol", value: "Protocol", width: "400px", minWidth: "40%" },
|
||||||
{ key: "port", value: "Port" },
|
{ key: "port", value: "Port" },
|
||||||
{ key: "rule", value: "Rule", sort: false },
|
{ key: "rule", value: "Rule", sort: false },
|
||||||
];
|
] as const;
|
||||||
const rows = [
|
const rows = [
|
||||||
{
|
{
|
||||||
id: "a",
|
id: "a",
|
||||||
|
@ -312,6 +311,7 @@
|
||||||
key: 'port',
|
key: 'port',
|
||||||
value: 'Port',
|
value: 'Port',
|
||||||
display: (value, row) => {
|
display: (value, row) => {
|
||||||
|
console.log(row.port);
|
||||||
return value + ' €';
|
return value + ' €';
|
||||||
},
|
},
|
||||||
sort: (a, b) => {
|
sort: (a, b) => {
|
||||||
|
@ -340,7 +340,7 @@
|
||||||
}}"
|
}}"
|
||||||
on:click="{(e) => {
|
on:click="{(e) => {
|
||||||
e.detail.cell;
|
e.detail.cell;
|
||||||
e.detail.row.name;
|
e.detail.row?.name;
|
||||||
}}"
|
}}"
|
||||||
on:click:row--expand="{(e) => {
|
on:click:row--expand="{(e) => {
|
||||||
const detail = e.detail;
|
const detail = e.detail;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue