Skip to main content
Create new
Introduction
Reactivity
Props
Logic
Events
Bindings
Lifecycle
Stores
Motion
Transitions
Animations
Easing
SVG
Actions
Classes
Component composition
Context API
Special elements
Module context
Debugging
7GUIs
Miscellaneous
App.svelte
PaneGroup.svelte
<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>
loading Svelte compiler...
/* Select a component to see its compiled code */
result = svelte.compile(source, {
generate: ,
});
/* Select a component to see its compiled code */