From 327f26d12a74f3938d9008c33493e1b2ce334059 Mon Sep 17 00:00:00 2001 From: Bram Date: Thu, 21 Nov 2024 19:07:49 +0100 Subject: [PATCH] Updated docs: Renamed children props to nodes for TreeView --- docs/src/pages/components/TreeView.svx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/src/pages/components/TreeView.svx b/docs/src/pages/components/TreeView.svx index fc35f110..297815dc 100644 --- a/docs/src/pages/components/TreeView.svx +++ b/docs/src/pages/components/TreeView.svx @@ -5,11 +5,15 @@ ## Default -The `children` prop accepts an array of child nodes. Each node should contain `id` and `text` properties. +The `nodes` prop accepts an array of child nodes. Each node should contain `id` and `text` properties. -Optional properties include `disabled`, `icon`, and `children`. +Optional properties include `disabled`, `icon`, and `nodes`. -A parent node contains `children` while a leaf node does not. +A parent node contains `nodes` (children) while a leaf node does not. + +Note: in version 0.86.0 the `children` prop has been renamed to `nodes` to be compatible with Svelte 5 (`children` +[has become a reserved word](https://svelte.dev/docs/svelte/v5-migration-guide#The-children-prop-is-reserved) in +Svelte 5 to pass properties down to components).
Every node must have a unique id.
@@ -27,7 +31,7 @@ The destructured `let:node` contains the following properties: id: the node id text: the node text expanded: true if the node is expanded - leaf: true if the node does not have children + leaf: true if the node does not have child nodes disabled: true if the node is disabled selected: true if the node is selected