Contextmenu 右键菜单

自定义右键菜单时使用

基础用法

使用menu插槽自定义右键菜单 UI。

使用组件的hide方法来关闭弹窗。

鼠标右击试试

单例模式

使用组件的handleContextMenu方法来处理右键。

当处理动态列表时,建议使用单例模式。动态循环该组件也能实现,只不过需要处理的逻辑会多点

Row 0 - Good morning, how are you?
Row 1 - Hi, good morning, I'm fine!
Row 2 - Good morning, how are you?
Row 3 - Hi, good morning, I'm fine!
Row 4 - Good morning, how are you?
Row 5 - Hi, good morning, I'm fine!
Row 6 - Good morning, how are you?
Row 7 - Hi, good morning, I'm fine!
Row 8 - Good morning, how are you?
Row 9 - Hi, good morning, I'm fine!

级联面板

使用options展示列表,使用change事件来接受选中的值

右击试试-

API

属性

属性名说明类型默认值
data当循环列表时特别有用,传入的值,可以在 menu 插槽中拿到null-
options级联选项Array-

Slots

事件名说明参数
default右键的触发器-
menu右键的菜单Object

Exposes

名称详情类型
hide关闭弹窗Function
handleContextMenu右击菜单Function

源代码

组件样式文档

贡献者