<script lang="ts">
import { PaneGroup, Pane, PaneResizer } from 'paneforge';
import PaneGroupComponent from './PaneGroup.svelte';
const getId = () => Math.floor(Math.random() * 100000).toString()
let group = {
id: getId(),
direction: 'horizontal',
panes: [
{ id: getId() },
{
id: getId(),
direction: 'vertical',
panes: [ { id: getId() }, { id: getId() } ],
},
],
};
const onclick = () => {
group.panes[1].panes.splice(1,0,{ id: getId() })
group=group
}
const onclick1 = () => {
group.panes[1].panes.push({ id: getId() })
group=group
}
</script>
<svelte:head>
<link rel="stylesheet" href="https://unpkg.com/tailwindcss@2.2.19/dist/tailwind.min.css"/>
</svelte:head>
<button class="mt-4 ml-4 border p-1" on:click={() => onclick()}>Insert item (splice)</button>