File tree 3 files changed +60
-3
lines changed
3 files changed +60
-3
lines changed Original file line number Diff line number Diff line change 42
42
</context-menu-group >
43
43
</context-menu-group >
44
44
<context-menu-item label =" Test dynamic change theme" :clickClose =" false" @click =" optionsComponent.theme = (optionsComponent.theme === 'dark' ? '' : 'dark')" />
45
+ <context-menu-group label =" Test Menu item slot" @subMenuOpen =" handleSubMenuOpen" >
46
+ <template #icon >
47
+ <i class =" iconfont icon-yidong" ></i >
48
+ </template >
49
+ <context-menu-item >
50
+ <template #label >
51
+ Custom label slot <span class =" test-tag" >tag name</span >
52
+ </template >
53
+ </context-menu-item >
54
+ <context-menu-item >
55
+ <template #label >
56
+ Custom shortcut slot
57
+ </template >
58
+ <template #shortcut >
59
+ <span class =" test-tag2" >#shortcut: my</span >
60
+ </template >
61
+ </context-menu-item >
62
+ <context-menu-item >
63
+ <template #label >
64
+ Custom icon slot
65
+ </template >
66
+ <template #icon >
67
+ <i class =" iconfont icon-terminal" ></i >
68
+ </template >
69
+ </context-menu-item >
70
+ <context-menu-item checked >
71
+ <template #label >
72
+ Custom check slot
73
+ </template >
74
+ <template #check >
75
+ ✔
76
+ </template >
77
+ </context-menu-item >
78
+ <context-menu-item showRightArrow >
79
+ <template #label >
80
+ Custom rightArrow slot
81
+ </template >
82
+ <template #rightArrow >
83
+ >>
84
+ </template >
85
+ </context-menu-item >
86
+ </context-menu-group >
45
87
</context-menu >
46
88
47
89
@@ -146,4 +188,19 @@ function changeLabelText() {
146
188
function alertContextMenuItemClicked(name : string ) {
147
189
alert (' You clicked ' + name + ' !' );
148
190
}
149
- </script >
191
+ </script >
192
+
193
+ <style >
194
+ .test-tag {
195
+ background-color : #efefef ;
196
+ padding : 5px ;
197
+ border-radius : 5px ;
198
+ margin-left : 10px ;
199
+ }
200
+ .test-tag2 {
201
+ background-color : #ff9a9a ;
202
+ padding : 5px ;
203
+ border-radius : 25px ;
204
+ margin-left : 10px ;
205
+ }
206
+ </style >
Original file line number Diff line number Diff line change 19
19
<div @contextmenu =" onContextMenu3($event, 'b')" >Bottom Center</div >
20
20
<div @contextmenu =" onContextMenu3($event, 'br')" >Bottom Right</div >
21
21
</div >
22
- <div class =" box2" style =" width : 170 px ; height : 140 px " :tabindex =" 1" @contextmenu =" onContextMenu($event)" @keydown =" handleKeyPress" >
22
+ <div class =" box2" style =" width : 270 px ; height : 80 px ; font-style : 15 px ; " :tabindex =" 1" @contextmenu =" onContextMenu($event)" @keydown =" handleKeyPress" >
23
23
Test keyboard event: Use arrow key to navigate menus.
24
24
<br >
25
25
Down div event catch: {{ testDownDivKey }}
Original file line number Diff line number Diff line change 42
42
</slot >
43
43
</div >
44
44
<div class =" mx-item-row" >
45
- <slot v-if =" shortcut" name =" shortcut" >
45
+ <slot v-if =" shortcut || $slots.shortcut " name =" shortcut" >
46
46
<VNodeRender v-if =" globalHasSlot('itemShortcutRender')" :vnode =" () => globalRenderSlot('itemShortcutRender', getItemDataForChildren())" />
47
47
<span class =" mx-shortcut" >{{ shortcut }}</span >
48
48
</slot >
You can’t perform that action at this time.
0 commit comments