# menu The **
Name
Type
Default Value
Mandatory
Description
target
string
-
No
Target element selector. After the target element selector is used, a menu is automatically displayed when you click the target element. The pop-up menu is preferentially displayed in the lower right corner of the target element. When the visible space on the right is insufficient, the menu is moved leftward. When the visible space in the lower part is insufficient, the menu is moved upward.
type
click
Mode in which the target element triggers the pop-up window. Available values are as follows:
title
Title of the pop-up window.
text-color
<color>
Font color of the menu.
font-size
<length>
30px
Font size of the menu.
allow-scale
boolean
true
Whether the font size changes with the system's font size settings.
If the config-changes tag of fontSize is configured for abilities in the config.json file, the setting takes effect without application restart.
letter-spacing
0
Character spacing of the menu.
font-style
normal
Font style of the menu. For details, see font-style of the text component.
font-weight
number | string
Font weight of the menu. For details, see font-weight of the text component.
font-family
sans-serif
Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font that exists in the system or the font specified by Custom Font Styles in the family is selected as the font for the text.
Parameter
selected
{ value:value }
Triggered when a value in the menu is selected. The returned value is the value attribute of the <option> component.
cancel
Triggered when an operation is canceled by the user
show
{ x:x, y:y }
Displays the menu. x and y specify the position of the displayed menu. x indicates the X-axis coordinate from the left edge of the visible area, and does not include any scrolling offset. y indicates the Y-axis coordinate from the upper edge of the visible area, and does not include any scrolling offset or a status bar. The menu is preferentially displayed in the lower right corner. When the visible space on the right is insufficient, the menu is moved leftward. When the visible space in the lower part is insufficient, the menu is moved upward.