{#if nodes && nodes.length > 0} {#each nodes as node, i} toggleNode(node, e.detail.open)} on:groupChange={(e) => checkNode(node, e.detail.checked, e.detail.indeterminate)} on:click={() => dispatch('click', { id: node.id })} on:toggle={() => { dispatch('toggle', { id: node.id }); }} > {#if typeof node.content === 'string'} {@html node.content} {:else} {/if} {#if typeof node.lead === 'string'} {@html node.lead} {:else} {/if} dispatch('click', { id: e.detail.id })} on:toggle={(e) => dispatch('toggle', { id: e.detail.id })} /> {/each} {/if}