摘要:先上圖連接安裝運(yùn)行使用接口一覽顯示菜單隱藏菜單綁定事件提供了事件解除綁定提供了事件
先上圖
github連接
安裝yarn install / npm install運(yùn)行
npm run dev使用
.icon-table{ background: url("build/styles/images/table.png") no-repeat center; } // or .icon-table:before{ content: ""; ... }
// listener event ContextMenu.on("itemclick", function (type, e, cmd) { console.log(arguments) }) // bind comtextmenu event document.querySelector(".somedom") .addEventListener("contextmenu", function (e) { ContextMenu.show([ { text : "item-0", command: "cmd-0", cls: "icon-table" }, "-", { text: "item-1", items: [ { text: "item-1-0", command: "cmd-1-0", disabled: true }, { text: "item-1-1", command: "cmd-1-1" } ] } ], e) })接口一覽
/* * 顯示菜單 */ ContextMenu.show(items: Array, e: Event): void /* * 隱藏菜單 */ ContextMenu.hide(): void /* * 綁定事件 * 提供了 itemclick 事件 */ ContextMenu.on(event: String, hanler: Function): void /* * 解除綁定 * 提供了 itemclick 事件 */ ContextMenu.off(event: String, hanler?: Function): void
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/50876.html
摘要:復(fù)制粘貼斷線重連等常見(jiàn)行為很容易找到,不需要教程或口口相傳的暗示。參考十項(xiàng)全能的遠(yuǎn)程終端登錄軟件開(kāi)源硬件佳軟介紹 提到SSH、Telnet等遠(yuǎn)程終端登錄,我相信很多人想到的都是PuTTY PuTTY通常用于Windows,但實(shí)際上可以多平臺(tái)運(yùn)行,因此不表達(dá)為Windows下的遠(yuǎn)程終端登錄 PuTTY足夠成熟、小巧、專(zhuān)注核心任務(wù),并且對(duì)編碼等常見(jiàn)坑的處理并不缺乏,這其實(shí)都是優(yōu)點(diǎn)。但PuT...
摘要:分享一些超好用插件,打造一個(gè)不一樣的瀏覽器編輯器。一谷歌瀏覽器插件谷歌訪問(wèn)助手強(qiáng)烈推薦一鍵安裝,無(wú)需其他配置,即可訪問(wèn)谷歌。谷歌瀏覽器是很耗內(nèi)存的,該插件會(huì)自動(dòng)掛起長(zhǎng)時(shí)間未使用的網(wǎng)頁(yè),來(lái)釋放系統(tǒng)資源。 showImg(https://segmentfault.com/img/remote/1460000014011338); 分享一些超好用插件,打造一個(gè)不一樣的 GitHub、瀏覽器、...
閱讀 2573·2021-11-22 12:05
閱讀 3459·2021-10-14 09:42
閱讀 1690·2021-07-28 00:15
閱讀 1995·2019-08-30 11:08
閱讀 1491·2019-08-29 17:31
閱讀 936·2019-08-29 16:42
閱讀 2343·2019-08-26 11:55
閱讀 2123·2019-08-26 11:49