click
Description
fires on clicking a menu bar item or outside the menu barParameters
- ev - (object) a CustomEvent object
Example
<script>
function clicked(ev){
const action = ev.detail.action;
message = action ? `clicked on ${action.id}` : "closed";
}
</script>
<MenuBar {options} on:click={clicked}></MenuBar>
Related article: Catching the change of a clicked option
Related sample: Menu bar