mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
test(tree-view): add more test cases
This commit is contained in:
parent
d7158ced73
commit
becb1503d8
2 changed files with 46 additions and 1 deletions
|
@ -7,7 +7,7 @@
|
|||
let treeview: TreeView;
|
||||
let activeId: TreeNodeId = "";
|
||||
let selectedIds: TreeNodeId[] = [];
|
||||
let expandedIds: TreeNodeId[] = [1];
|
||||
let expandedIds: TreeNodeId[] = [];
|
||||
let nodes: ComponentProps<TreeView>["nodes"] = [
|
||||
{ id: 0, text: "AI / Machine learning", icon: Analytics },
|
||||
{
|
||||
|
@ -81,3 +81,12 @@
|
|||
</TreeView>
|
||||
|
||||
<Button on:click={treeview.expandAll}>Expand all</Button>
|
||||
<Button
|
||||
on:click={() => {
|
||||
treeview.expandNodes((node) => {
|
||||
return /^IBM/.test(node.text);
|
||||
});
|
||||
}}
|
||||
>
|
||||
Expand some nodes
|
||||
</Button>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue