├── .gitignore ├── LICENSE.md ├── README.md ├── index.vue └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Tim Wisniewski 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-lil-context-menu 2 | 3 | A flexible context menu component for Vue. Pass it any menu template you like; 4 | it doesn't even have to be a menu. Always disappears when you expect it 5 | to by using an `onblur` event. 6 | 7 | ```html 8 |
9 | ... 10 |
11 | 12 | 13 | 17 | 18 | 19 | 33 | 34 | 40 | ``` 41 | 42 | If you'd like to pass any context from the original `oncontextmenu` 43 | event down to your menu template, you can pass it as the second 44 | param of `open` and access it within a [scoped slot](https://vuejs.org/v2/guide/components.html#Scoped-Slots) 45 | under the `userData` property. For example: 46 | 47 | ```html 48 |
49 | ... 50 |
51 | 52 | 53 | 57 | 58 | ``` 59 | 60 | ## Related 61 | - [vue-context-menu](https://github.com/vmaimone/vue-context-menu) 62 | -------------------------------------------------------------------------------- /index.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 52 | 53 | 62 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-lil-context-menu", 3 | "version": "1.1.0", 4 | "description": "A flexible context menu component for Vue", 5 | "main": "index.vue", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/timwis/vue-lil-context-menu.git" 12 | }, 13 | "keywords": [ 14 | "vue", 15 | "context", 16 | "menu" 17 | ], 18 | "author": "timwis ", 19 | "license": "MIT", 20 | "bugs": { 21 | "url": "https://github.com/timwis/vue-lil-context-menu/issues" 22 | }, 23 | "homepage": "https://github.com/timwis/vue-lil-context-menu#readme", 24 | "dependencies": { 25 | "vue": "^2.3.3" 26 | }, 27 | "devDependencies": { 28 | "vueify": "^9.4.1" 29 | }, 30 | "browserify": { 31 | "transform": [ 32 | "vueify" 33 | ] 34 | } 35 | } 36 | --------------------------------------------------------------------------------