1. v-contextmenu
ContextMenu based on Vue 2.0
v-contextmenu
Package: v-contextmenu
Created by: CyberNika
Last modified: Mon, 04 Mar 2024 07:42:40 GMT
Version: 2.9.2
License: MIT
Downloads: 17,923
Repository: https://github.com/CyberNika/v-contextmenu

Install

npm install v-contextmenu
yarn add v-contextmenu

v-contextmenu

NPM version
NPM download
NPM version
License
Node version

NPM

适用于 Vue 2.0 的 ContextMenu 组件。

中文 | English

安装

CDN 引入

可通过 unpkg.com/v-contextmenu@2 获取最新版本的资源,在页面中引入相应 js 和 css 文件即可。

 <!-- 引入 Vue2 -->
<script src="https://unpkg.com/vue@2/dist/vue.js"></script>

<!-- 引入 VContextmenu 组件 -->
<script src="https://unpkg.com/v-contextmenu@2/dist/index.js"></script>

<!-- 引入 VContextmenu 组件样式 -->
<link rel="stylesheet" href="https://unpkg.com/v-contextmenu@2/dist/index.css">

建议使用 NPM 安装

NPM 安装

 $ npm i -S v-contextmenu@2 # yarn add v-contextmenu@2

概览

概览

访问在线示例查看在线示例 GIF

使用

一个简单的例子

 import contentmenu from 'v-contextmenu'
import 'v-contextmenu/dist/index.css'

Vue.use(contentmenu)
 <template>
  <v-contextmenu ref="contextmenu">
    <v-contextmenu-item>菜单1</v-contextmenu-item>
    <v-contextmenu-item>菜单2</v-contextmenu-item>
    <v-contextmenu-item>菜单3</v-contextmenu-item>
  </v-contextmenu>

  <div v-contextmenu:contextmenu>右键点击此区域</div>
</template>

详细使用方法见 文档 & 例子

如果你需要单独引入组件使用,请查看单独引用

主题

提供三种主题,使用方法见 VContextmenu

默认

default

亮色

bright

暗色

dark

开发

 $ npm install
$ npm run dev

构建

 $ npm run build:package # 构建 npm 包
$ npm run build:example # 构建示例站点
$ npm run build # build:package & build:example

更新日志

详见 releases

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin