You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[View on npm](https://www.npmjs.com/package/vue-simple-context-menu)
17
+
Vue 3 is supported from `v4.0.0` and beyond (current `master`). To use `vue-simple-context-menu` with Vue 2, use `v3.4.2`.
18
18
19
-
[View on GitHub](https://github.com/johndatserakis/vue-simple-context-menu)
20
-
21
-
### Install
19
+
## Install
22
20
23
21
```
24
-
# npm
25
-
npm i vue-simple-context-menu
26
-
27
-
# yarn
28
22
yarn add vue-simple-context-menu
29
23
```
30
24
@@ -40,25 +34,25 @@ Or you can include it through the browser at the bottom of your page along with
40
34
/>
41
35
```
42
36
43
-
###About
37
+
## About
44
38
45
-
Just a simple little menu to be shown where a click happens - closes after use automatically by clicking an option or outside of the menu. Multiple menus are supported - just make sure to use a unique string as your `elementId` prop value.
39
+
Just a simple little menu to be shown where a click happens - closes after use automatically by clicking an option or outside of the menu. Multiple menus are supported - just make sure to use a unique string as your `element-id` prop value.
46
40
47
41
A nice feature that comes baked in is the menu placement after a click - it sits just ever so slightly under your click location - so that any hover style you had on the item that was clicked gets removed nicely. I modeled it after the macOS right click menu.
48
42
49
-
###Usage Example
43
+
## Usage Example
50
44
51
45
```css
52
-
/*css import for when you want to import the component css into your css file/files */
|`option-clicked`| Object | When a menu item is clicked the component will emit an event with a value containing the clicked item and the menu option that was clicked. Register for this event to capture the selection result. |
125
119
|`menu-closed`|| Emitted when the menu is closed |
126
120
127
-
###SASS Structure
121
+
## SASS Structure
128
122
129
123
```scss
130
124
.vue-simple-context-menu {
@@ -141,38 +135,36 @@ Note - make sure to use `@click.prevent.stop` (or `@contextmenu.prevent.stop` fo
141
135
}
142
136
```
143
137
144
-
###Development
138
+
## Development
145
139
146
140
```bash
147
-
#install dependencies
148
-
npm install
141
+
#Install dependencies
142
+
yarn
149
143
150
-
#serve with hot reload
151
-
npm run watch
144
+
#Serve with hot reload
145
+
yarn watch
152
146
153
-
#run the tests
154
-
npm runtest
147
+
#Run the tests
148
+
yarntest
155
149
156
-
#build demo page
157
-
npm run build:example
150
+
#Build demo page
151
+
yarn build:example
158
152
159
-
#build library
160
-
npm run build:library
153
+
#Build library
154
+
yarn build:library
161
155
162
-
#build everything and run tests
163
-
npm run build
156
+
#Build everything and run tests
157
+
yarn build
164
158
```
165
159
166
-
###Other
160
+
## Other
167
161
168
162
Go ahead and fork the project! Submit an issue if needed. Have fun!
169
163
170
-
###Thank You
164
+
## Thank You
171
165
172
166
Influenced by [Lucas Calazans](https://codepen.io/lucascalazans)'s [pen](https://codepen.io/lucascalazans/pen/ALvVVw). Go ahead and check out his other work.
173
167
174
-
###License
168
+
## License
175
169
176
170
[MIT](http://opensource.org/licenses/MIT)
177
-
178
-
Packaged with a mixture of [vue-lib-template](https://github.com/biigpongsatorn/vue-lib-template) and [vue-sfc-rollup](https://github.com/team-innovation/vue-sfc-rollup).
0 commit comments