# Contextmenu component

# Code examples

# API

# Contextmenu component template

Template example:

<contextmenu name="fv--custom-contextmenu">
    <contextmenu-item >Click to show a alert</contextmenu-item>
    <contextmenu-item>Click to do nothing</contextmenu-item>
    <contextmenu-separator></contextmenu-separator>
    <contextmenu-item icon-class="fv__icon-comment-item-menu-copy">Copy</contextmenu-item>
    <contextmenu-item icon-class="fv__icon-comment-item-menu-delete">Delete</contextmenu-item>
</contextmenu>

# Methods

Contextmenu methods

Method Description Version
showAt(x: number, y: number):void Shows on the specified coordinates, where the x and y axes are relative to the browser viewport . 7.2.0

For more information, you may check layer component.

Contextmenun item method:

For details, you may check button component.

# Events

Contextmenu events are same as layer component.