Code Monkey home page Code Monkey logo

Comments (13)

CyberNika avatar CyberNika commented on May 28, 2024 1

@jwencode这个例子中可以看到,看 console 里。
例子代码在 https://github.com/snokier/v-contextmenu/blob/master/examples/Multiple.vue#L9

from v-contextmenu.

elewen avatar elewen commented on May 28, 2024 1
<span v-contextmenu:contextmenu  :myParams="{ a: 1 }"  value='233'>aaa</span>
<span v-contextmenu:contextmenu  :myParams="{ b: 2 }"  value='666'>bbb</span>

<v-contextmenu ref="contextmenu" theme="bright" @contextmenu="test" @show="showContextMenu"></v-contextmenu>
test (vm) {
  console.log(vm.data.attrs.myParams) // { a: 1 }
  console.log(vm.data.attrs.value) // 233
}

from v-contextmenu.

jwencode avatar jwencode commented on May 28, 2024

我也需要这个功能,获取点击的数据。可否加一个传参的功能。

from v-contextmenu.

CyberNika avatar CyberNika commented on May 28, 2024

#46 VContextmenu 组件上有个 contextmenu 事件,参数是触发 contextmenu 事件区域的 vnode,应该满足你们的需求
https://github.com/snokier/v-contextmenu/blob/master/docs/usage.md#vcontextmenu

from v-contextmenu.

jwencode avatar jwencode commented on May 28, 2024

根据你说的,我看了vnode,但是在事件中无法获取到vnode的参数,可以给出参考案例吗?感谢

from v-contextmenu.

sanri1993 avatar sanri1993 commented on May 28, 2024

vnode 只能获取节点 dom 元素啊

from v-contextmenu.

jwencode avatar jwencode commented on May 28, 2024

vnode 只能获取节点 dom 元素啊

可以加一个@contextmenu事件 右键点击事件 传递对象 然后间接操作

from v-contextmenu.

htank-wang avatar htank-wang commented on May 28, 2024

@contextmenu在v-contextmenu的事件后触发,想禁用容器下的某个子节点的菜单触发。

from v-contextmenu.

zuoyifeng avatar zuoyifeng commented on May 28, 2024

@contextmenu

弹出的里面@contextmenu回调加什么 怎么加?我是公用的右键 想根据数据判断

from v-contextmenu.

co2color avatar co2color commented on May 28, 2024

image
image
image
如图, element tree组件,鼠标右键点击某个tree节点,先执行treeRightClick(),拿到node,给this.current_tree_node。然后操作就好了

from v-contextmenu.

xiaochen0517 avatar xiaochen0517 commented on May 28, 2024

在新的 3.1.1 版本中没有 contextmenu 事件,此功能需要如何实现?

from v-contextmenu.

zhangzq avatar zhangzq commented on May 28, 2024
v-contextmenu

这个可以用吗?我测试的 test 函数的参数是空的,vm是undefined呀。

from v-contextmenu.

zhangzq avatar zhangzq commented on May 28, 2024

最新的测试如下:

如果指定v-contextmenu:contextmenu的容器上添加 @contextmenu 事件,其event参数有个问题,有时候是子节点,不能保证是此容器。

如果是menu本身添加 @contextmenu ,完全不起作用。

from v-contextmenu.

Related Issues (20)

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.