Skip to content

Commit 1f13bc4

Browse files
Update README
1 parent 68a8fc2 commit 1f13bc4

10 files changed

+18
-28
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CHANGELOG.md
22

3-
## 4.0.0
3+
## 4.0.1
44

55
- Upgrade package to support Vue 3. Vue 2 support can be found at `v3.4.2`. Thank you @danielelkington.
66

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ Simple context-menu component built for Vue. Works well with both left and right
1010
<img src="https://img.shields.io/twitter/url/https/github.com/johndatserakis/vue-simple-context-menu.svg?style=social" alt="Tweet"></a>
1111
</p>
1212

13-
[View Demo](https://johndatserakis.github.io/vue-simple-context-menu/) | [GitHub](https://github.com/johndatserakis/vue-simple-context-menu) | [npm](https://www.npmjs.com/package/vue-simple-context-menu)
13+
- [Demo](https://johndatserakis.github.io/vue-simple-context-menu/)
14+
- [GitHub](https://github.com/johndatserakis/vue-simple-context-menu)
15+
- [npm](https://www.npmjs.com/package/vue-simple-context-menu)
16+
- [StackBlitz](https://stackblitz.com/edit/vue-chj3sg?file=src/App.vue)
1417

1518
## Vue 3 Support
1619

@@ -40,19 +43,16 @@ Just a simple little menu to be shown where a click happens - closes after use a
4043

4144
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.
4245

43-
## Usage Example
44-
45-
```css
46-
/* CSS import for when you want to import the component CSS into your CSS file/files */
47-
@import '/path/to/node_modules/vue-simple-context-menu.css';
48-
```
46+
## Usage
4947

5048
```js
51-
// CSS import for when you're importing the CSS directly in your JS
52-
import 'vue-simple-context-menu/dist/vue-simple-context-menu.css';
49+
import { createApp } from 'vue';
5350
import VueSimpleContextMenu from 'vue-simple-context-menu';
51+
import 'vue-simple-context-menu/dist/vue-simple-context-menu.css';
52+
53+
const app = createApp(App);
5454

55-
Vue.component('vue-simple-context-menu', VueSimpleContextMenu);
55+
app.component('vue-simple-context-menu', VueSimpleContextMenu);
5656
```
5757

5858
```html
@@ -142,7 +142,7 @@ Note - make sure to use `@click.prevent.stop` (or `@contextmenu.prevent.stop` fo
142142
yarn
143143

144144
# Serve with hot reload
145-
yarn watch
145+
yarn dev
146146

147147
# Run the tests
148148
yarn test

dist/vue-simple-context-menu.esm.js

-2
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,13 @@ script.__file = "src/vue-simple-context-menu.vue";
130130

131131
// Import vue component
132132

133-
// Install function executed by app.use()
134133
function install(app) {
135134
if (install.installed) { return; }
136135

137136
install.installed = true;
138137
app.component('VueSimpleContextMenu', script);
139138
}
140139

141-
// Create module definition for Vue.use()
142140
var plugin = { install: install };
143141

144142
// To auto-install when Vue is found

dist/vue-simple-context-menu.umd.js

-2
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,13 @@
134134

135135
// Import vue component
136136

137-
// Install function executed by app.use()
138137
function install(app) {
139138
if (install.installed) { return; }
140139

141140
install.installed = true;
142141
app.component('VueSimpleContextMenu', script);
143142
}
144143

145-
// Create module definition for Vue.use()
146144
var plugin = { install: install };
147145

148146
// To auto-install when Vue is found

docs/build.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
1717
crossorigin="anonymous"
1818
/>
19-
<link href="/vue-simple-context-menu/main.css" rel="stylesheet"></head>
19+
</head>
2020

2121
<body>
2222
<div id="app"></div>

docs/main.css

-5
This file was deleted.

docs/main.css.map

-1
This file was deleted.

example/main.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { createApp } from 'vue';
22
import App from './App.vue';
3+
import VueSimpleContextMenu from '../src/index.js';
34

45
const app = createApp(App);
56

6-
import VueSimpleContextMenu from '../src/index.js';
7-
87
app.component('vue-simple-context-menu', VueSimpleContextMenu);
98

109
app.mount('#app');

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@
8989
"build:umd": "rollup --config rollup.config.js --format umd --file dist/vue-simple-context-menu.umd.js",
9090
"build:unpkg": "rollup --config rollup.config.js --format iife --file dist/vue-simple-context-menu.min.js",
9191
"test": "jest",
92-
"watch": "cross-env NODE_ENV=development webpack-dev-server --open --hot"
92+
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot"
9393
},
94+
"sideEffects": false,
9495
"unpkg": "dist/vue-simple-context-menu.min.js",
95-
"version": "4.0.0"
96+
"version": "4.0.1"
9697
}

0 commit comments

Comments
 (0)