Git Product home page Git Product logo

vue-node-context-menu's Introduction

vue-node-context-menu

vue 2.0+ 自定义指令 右键菜单 获取当前数据和点击菜单的数据

How to use for vue2.0+

#import package
npm i vue-node-context-menu

#use(at your main.js)
import VueNodeContextMenu from 'vue-node-context-menu';

#how to use 
#for example 举个例子
#at your html
<div v-node-context-menu="{node:item,menu:menu}" v-for="(item,index) in list" ></div>
#at your js
node:当前数据
menu:为右键菜单数据
list: 当前遍历的数组
## js list
data(){
  return {
    list:[
      {
        name:'1',
        id:0
      }
    ],
    menu:[
      {
        text:"返回",
        icon:"",
        handler:this.nodeConextMenu
      },
      {
        text:"重新加载",
        icon:"",
        handler:this.nodeConextMenu
      },
      {
        text:"打印",
        icon:"",
        handler:this.nodeConextMenu
      }
    ]
  }
}
methods:{
  #click menu to callbck  点击菜单选项的回调函数 node 为当前点击的数据,menu为当前点击菜单的对象
  nodeConextMenu(node,menu){
    
  }
}
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

vue-node-context-menu's People

Contributors

heaven9277 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.