useMenuBar function

Module @runic-artifex/vue in @runic-artifex/vue 0.23.0

function useMenuBar(options?: UseMenuBarOptions): MenuBarHandle;

Follows the window's declared menu bar (Runic Desktop's DesktopMenuBarPresentation.Page) as a shallow ref, as headless state for the application's own menubar component, through createMenuBarController, until the current effect scope is disposed. Call it in setup() or effectScope().run(): outside an effect scope it is never released (development builds warn). Server rendering creates no controller and stays connecting. ```vue const open = ref(""); const { state: menuBar, invoke } = useMenuBar({ onRequest: request => { if (request.kind === "open") open.value = request.menu.key; } }); <MenubarRoot v-if="menuBar.placement === 'page'" v-model="open">…<MenubarItem