{#each tree as item, i (item.id)}
{item.id} {#if item.sub} {/if}
{/each}