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 |