<Panel />
<Panel />
組件可協助您將內容放置在視口上方。它在內部被 <MiniMap />
和 <Controls />
組件所使用。
<script lang="ts">
import { writable } from 'svelte/store';
import { SvelteFlow, Panel } from '@xyflow/svelte';
const nodes = writable([]);
const edges = writable([]);
</script>
<SvelteFlow nodes={nodes} edges={edges}>
<Panel position="top-left">top-left</Panel>
<Panel position="top-center">top-center</Panel>
<Panel position="top-right">top-right</Panel>
<Panel position="bottom-left">bottom-left</Panel>
<Panel position="bottom-center">bottom-center</Panel>
<Panel position="bottom-right">bottom-right</Panel>
</SvelteFlow>
屬性
對於 TypeScript 使用者,<Panel />
組件的屬性類型會匯出為 PanelProps
。
名稱 | 類型 |
---|---|
# position | PanelPosition |
# children |