File tree Expand file tree Collapse file tree 4 files changed +20
-8
lines changed
Expand file tree Collapse file tree 4 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -95,11 +95,12 @@ Note - make sure to use `@click.prevent.stop` (or `@contextmenu.prevent.stop` fo
9595
9696| prop | type | description | required |
9797| ---------| -------| --------------------------------| ---|
98- | elementId | String | Unique String that acts as the id of your menu. | Yes |
99- | options | Array | Array of menu options to show. Component will use the ` name ` parameter as the label. | Yes |
100- | options.name | Array | Label for the option. | Yes |
101- | options.class | String | A custom class that will be applied to the option. | No |
102- | ref | String | Unique String that allows you to show the menu on command. | Yes |
98+ | elementId | String | Unique String that acts as the id of your menu. | Yes |
99+ | options | Array | Array of menu options to show. Component will use the ` name ` parameter as the label. | Yes |
100+ | options.name | Array | Label for the option. | Yes |
101+ | options.class | String | A custom class that will be applied to the option. | No |
102+ | options.type | String | Only one possible value at the moment - ` divider ` . Pass this to set the object as a divider. | No |
103+ | ref | String | Unique String that allows you to show the menu on command. | Yes |
103104
104105### Methods
105106
@@ -115,7 +116,7 @@ Note - make sure to use `@click.prevent.stop` (or `@contextmenu.prevent.stop` fo
115116
116117### SASS Structure
117118
118- ``` sass
119+ ``` scss
119120.vue-simple-context-menu {
120121 & --active {
121122 }
Original file line number Diff line number Diff line change @@ -163,6 +163,9 @@ export default {
163163 name: ' Duplicate' ,
164164 slug: ' duplicate'
165165 },
166+ {
167+ type: ' divider'
168+ },
166169 {
167170 name: ' Edit' ,
168171 slug: ' edit'
Original file line number Diff line number Diff line change 11{
22 "name" : " vue-simple-context-menu" ,
3- "version" : " 3.2 .0" ,
3+ "version" : " 3.3 .0" ,
44 "description" : " Simple context-menu component built for Vue. Works well with both left and right clicks. Nothing too fancy, just works and is simple to use." ,
55 "author" : " John Datserakis <johndatserakis@gmail.com>" ,
66 "license" : " MIT" ,
Original file line number Diff line number Diff line change 1010 :key =" index"
1111 @click.stop =" optionClicked(option)"
1212 class =" vue-simple-context-menu__item"
13- :class =" option.class"
13+ :class =" [ option.class, (option.type === 'divider' ? 'vue-simple-context-menu__divider' : '')] "
1414 >
1515 {{option.name}}
1616 </li >
@@ -146,6 +146,14 @@ $black: #333;
146146 }
147147 }
148148
149+ & __divider {
150+ height : 10px ;
151+ background-color : $grey ;
152+ padding : 4px 0 ;
153+ background-clip : content-box ;
154+ pointer-events : none ;
155+ }
156+
149157 // Have to use the element so we can make use of `first-of-type` and
150158 // `last-of-type`
151159 li {
You can’t perform that action at this time.
0 commit comments