vue右鍵事件——顯示iview菜單欄

先取消右鍵的默認事件 e.preventDefault() 獲取當前點擊的標籤 this.$refs.contextMenu.$refs.reference = event.target 顯示菜單欄 this.$refs.contextMenu.currentVisible = true 然後設置菜單欄顯示的位置 效果圖:  
相關文章
相關標籤/搜索