Skip to main content

parent

Description

an optional HTML reference used as a menu parent

Type

HTMLElement

Example

<script>
let menu1 = null;
</script>

<Button type="primary" onclick={ev => menu1 = ev.target}>Click me (bottom menu)</Button>

{#if menu1}
<Portal>
<Menu {options} parent={menu1} onclick={clicked}></Menu>
</Portal>
{/if}

Related article: Setting the parent of Menu

Related sample: Menu basic