Skip to content

Latest commit

 

History

History
52 lines (42 loc) · 1.13 KB

README.md

File metadata and controls

52 lines (42 loc) · 1.13 KB

vue3右键菜单组件

demo

Install

npm i vue3-right-click-menu

Usage

// 引入样式
import 'vue3-right-click-menu/style.css'
// 注册组件
import { RightClick } from 'vue3-right-click-menu'
app.component('vue-right-click', RightClick)
  <RightClick
    :menu="menu"
    @select="handleSelect"
  >
    // container 只对slot内容区域生效
    <main class="main" />
  </RightClick>

Params

const menu = [
  { label: '新增', user: 'simon' },
  { label: '删除', user: 'simon' },
  { label: '编辑', user: 'simon' },
]

Events

 -> select
 选择后触发select事件,接收menuItem

样式不满足可重写覆盖

License

MIT License © 2022 Simon He

Buy Me A Coffee

sponsors