Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

self-right-menus

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

self-right-menus

这是一个基于Vue的自定义右键无限层级菜单项目

  • 1.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

self-right-menus

一个自定义的右键无限层级菜单指令

插件安装 yarn add self-right-menus

npm install self-right-menus --save

插件使用

在项目的入口文件main.ts/main.js中加入下述代码

import rightMenus from "self-right-menus"

Vue.use(rightMenus);

在你的业务代码中,在元素上绑定v-right-menu,然后传对应的参数即可.

传值必须是对象 配置说明 包含哪些键值对

属性说明 类型 默认值
width右键菜单宽度Number166
content右键菜单内容数组对象Array必传
children子集菜单对象,有这个对象代表含有子集菜单项Object非必传

content 配置说明

属性说明 类型 默认值
label菜单名称String必传
handler菜单操作方法Function非必传
disabled菜单是否禁用Booleanfalse
berak菜单分割线位置(默认三个为一组分割)Booleanfalse

children 配置说明

属性说明 类型 默认值
width右键菜单宽度Number166
content右键菜单内容数组对象Array必传
children子集菜单对象,有这个对象代表含有子集菜单项Object非必传

例子

<template>

  <div
    v-right-menu="rightMenus"
  >
  </div>

</template>

<script>

export default {
       data(){
           return {
               rightMenus:{
                   width:190,//右键菜单宽度 ;默认值166
                   content:[
                       {
                          label:'复制',//右键菜单子项名称 (必需值)
                          handler:this.copy,//右键菜单子项方法(可选值)
                          disabled:boolean,//子项是否禁用(可选值)
                          break:boolean,//子项分割线标准(不给值默认3个为一组分割)
                          children:{
                             width:180,
                             content:[{
                                 label:'复制',//右键菜单子项名称 (必需值)
                                  handler:this.copy,//右键菜单子项方法(可选值)
                                  disabled:boolean,//子项是否禁用(可选值)
                                  break:boolean,//子项分割线标准(不给值默认3个为一组分割)
                             }]
                          }
                       }
                   ]
               }
           }
       },
       methods:{
         copy(){

         }
       }

  }

}

</script>

Keywords

FAQs

Package last updated on 30 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc