Basic Menu API
Initialization
<script>
import { Menu } from "wx-svelte-menu";
import { getOptions } from "./data";
const options = getOptions();
</script>
<Menu {options}></Menu>
Related resources
- Visit the Features Guide to learn more about the widget's functionality.
- Explore the samples to visualize the available features.
Properties
at | specifies the position of the menu relative to the target node |
context | a context object related to the clicked menu item |
left | sets the left offset of a menu in pixels |
mount | attaches Menu to a custom Portal |
options | a set of menu options |
parent | an optional HTML reference used as a menu parent |
top | sets the top offset of a menu in pixels |
Events
click | fires on clicking a menu item or outside the menu |