vue3-context-menu-plus 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: eggYolkegg
|
|
3
3
|
* @Date: 2025-12-11 15:41:57
|
|
4
4
|
* @LastEditors: eggYolkegg
|
|
5
|
-
* @LastEditTime: 2025-12-17 15:
|
|
5
|
+
* @LastEditTime: 2025-12-17 15:24:49
|
|
6
6
|
* @Description:
|
|
7
7
|
-->
|
|
8
8
|
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
🔧 自定义菜单点击回调,携带完整上下文信息
|
|
17
17
|
⚡ 指令式调用,接入成本低
|
|
18
18
|
|
|
19
|
+
git地址:https://github.com/eggyolkegg/vue3-context-menu-plus
|
|
20
|
+
|
|
19
21
|
## 安装
|
|
20
22
|
|
|
21
23
|
```bash
|
|
@@ -27,7 +29,7 @@ yarn add vue3-context-menu
|
|
|
27
29
|
|
|
28
30
|
## 使用用法
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
```bash
|
|
31
33
|
在 main.js / main.ts 文件中
|
|
32
34
|
import { createApp } from 'vue'
|
|
33
35
|
import App from './App.vue'
|
|
@@ -37,26 +39,29 @@ const app = createApp(App)
|
|
|
37
39
|
app.use(VueContextMenu) // 注册全局指令
|
|
38
40
|
app.mount('#app')
|
|
39
41
|
|
|
42
|
+
```
|
|
43
|
+
|
|
40
44
|
## 模版
|
|
41
45
|
|
|
46
|
+
```bash
|
|
42
47
|
<template>
|
|
43
48
|
<!-- 用法1:v-contextmenu:10(10:当前组件的层级可以调成任何纯数字,如果不写默认9999) + 当第一参数是对象是,需要配置配置data-component匹配菜单 -->
|
|
44
|
-
<div
|
|
45
|
-
data-component="component-a"
|
|
49
|
+
<div
|
|
50
|
+
data-component="component-a"
|
|
46
51
|
v-contextmenu:10="{ menus: componentMenus,onItemClick: handleClick }"
|
|
47
52
|
>
|
|
48
53
|
右键点击(组件A)
|
|
49
54
|
</div>
|
|
50
55
|
|
|
51
|
-
<div
|
|
52
|
-
data-component="component-b"
|
|
56
|
+
<div
|
|
57
|
+
data-component="component-b"
|
|
53
58
|
v-contextmenu="{ componentMenus, onItemClick: handleClick }"
|
|
54
59
|
>
|
|
55
60
|
右键点击(组件B)
|
|
56
61
|
</div>
|
|
57
62
|
|
|
58
63
|
<!-- 用法2:自定义菜单(不依赖data-component) -->
|
|
59
|
-
<div
|
|
64
|
+
<div
|
|
60
65
|
v-contextmenu="{customMenus, handleClick }"
|
|
61
66
|
>
|
|
62
67
|
右键点击(自定义菜单)
|
|
@@ -107,3 +112,4 @@ export default {
|
|
|
107
112
|
}
|
|
108
113
|
}
|
|
109
114
|
</script>
|
|
115
|
+
```
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "vue3-context-menu-plus",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"description": "A Vue 3 context menu component that shows different menus based on different components",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
7
7
|
"module": "dist/index.esm.js",
|