1.7.4 • Published 1 month ago
crmenu v1.7.4
crmenu
A beautiful right-click menu,
Improved and encapsulated by the example of the original author knyttneve https://codepen.io/knyttneve/pen/YzxEBew
Install
npm install crmenu
How to use
import ContextMenu from "crmenu";
import "crmenu/style.css";
const copyIcon = `<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>`;
const menuItems = [
{
content: () => {
return `${copyIcon}复制`;
},
events: {
click: (e) => {
console.log(rightMenu);
console.log(`此处被点击了`);
},
},
},
];
const rightMenu = new ContextMenu({
target: ".rigth-menu-box",
mode: "light", // dark
menuItems,
});
rightMenu.init();
1.7.4
1 month ago
1.7.3
12 months ago
1.6.4
12 months ago
1.7.2
12 months ago
1.6.3
12 months ago
1.7.1
12 months ago
1.6.2
12 months ago
1.7.0
12 months ago
1.6.1
12 months ago
1.6.9
12 months ago
1.6.8
12 months ago
1.6.7
12 months ago
1.6.6
12 months ago
1.6.5
12 months ago
1.2.8
1 year ago
1.2.7
1 year ago
1.2.6
1 year ago
1.2.5
1 year ago
1.6.0
1 year ago
1.2.4
1 year ago
1.5.0
1 year ago
1.2.3
1 year ago
1.4.0
1 year ago
1.2.2
1 year ago
1.3.0
1 year ago
1.2.1
1 year ago
1.2.9
1 year ago
1.2.10
1 year ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago